Page 1 of 1

How to use Sort Utlity for a variable record

PostPosted: Thu Sep 03, 2015 5:36 pm
by shaishav
Hi,

I am Having a file containing few column of records like wise:
|830001|+10000|-9000.00
|830002|+100|-900.00
|830003|+12|-90.00
|830004|+0.00|+0.00


I need to sum the values using Sort Utility between 2nd and 3rd pipe delimeter(like 10000+100+12+0),also record after 3rd pipe(-9000-900-90+0) and move them into another ourput file and display the total value as
Total 1:sum of reocrds between 2nd and 3rd pipe delimeter
Total 2:sum of records after 3rd Pipe delimeter

Please Help.

Re: How to use Sort Utlity for a variable record

PostPosted: Thu Sep 03, 2015 6:56 pm
by NicC
Are you trying to do this within a COBOL program (you posted in the COBOL part of the forum) or by using one of the Sort utilities (which one - DFSort or Syncsort)?

Re: How to use Sort Utlity for a variable record

PostPosted: Fri Sep 04, 2015 10:56 am
by shaishav
Sorry to post it in cobol Forum, no i am not doing it with cobol i need to do it with dfsort.

Re: How to use Sort Utlity for a variable record

PostPosted: Fri Sep 04, 2015 2:28 pm
by NicC
You need to describe your input dataset (RECFM, LRECL) and provide representative sample data (are there different record types, can there be duplicates, etc) and your expected output from the sample data along with the rules for getting from input to output. You should also use the code tags when presenting data, JCL, messages etc from the screen. Look around the forum on how to use the code tags (use the Postreply button instead of the QuickReply box.

I have moved the topic and coded your data.