I have the following requirement. There are four S9(11)V99 comp-3 fields in my input file.
i need to add all the these fields and write to my output file which is againa S9(11)V99 COmp-3 field.
Input field positions are:
Field1 : position 60
field 2 : position 67
field 3 : position 130
field 4: position 116
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Do you want a total of each field (vertical total) or do you want a total of each set of four fields (horizontal total)? Where do you want the totals or total?
Please show an example of the records in your input file and what you expect for output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of all relevant fields.
I need a horizontal total. These four fields correspond to different amount fields. So the output file would carry a sum of all the amount fields int he input file. I have already given the starting positions of the fields. For my request, LRECL is 50 and RECFM is FB.
And the output amount filed would be starting from 37th position. I have got soem values to be populated for the position from 1 - 36.
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Thanks for the reply. But i got a soc7 when i executed this. Please find below the sortcard which i have used.My output file is of 50 record length.
The first 8 characters are to be picked up from the input file.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
An S0C7 would indicate an invalid PD value, so either:
1) Your PD fields are NOT in the positions you say they are or
2) Your PD fields are NOT the length you say they are or
3) You have an invalid PD value in one of the fields.
You can use the VERIFY function of DFSORT's ICETOOL to check for invalid PD values - see: