here I have given only one amount. it should be 4 amounts. for all the amounts the last byte is character.
If you could see the input file the last byte is character. I tried to run with the same sort card, it was giving S0C7. Could you please help me out on this.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
The 447G amount is equivalent to 4477 and should work fine with ZD. 'G' = X'C7' = 7 and a + sign.
However, it appears that the 447G amount starts in position 21 rather than in position 20. If so, the SUM statement would have to be adjusted accordingly.
What is the starting position of each of the 4 amounts?
What do you want the summed amount in the output to look like? Do you want the last byte to be a character (e.g. 'G' = X'C7') or a number (e.g. '7' = X'F7')?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
If you want the last byte of positive summed ZD values to use a C sign (e.g. 'G' = X'C7') rather than an F sign (e.g. '7' = X'F7'), just change
Code:
OPTION ZDPRINT
to:
Code:
OPTION NZDPRINT
However, you said you got an S0C7. That would only occur if you had the WRONG starting position or length for one of the SUM fields, or an invalid value in one of the SUM fields. Be sure to check that your starting positions and lengths are correct.
Finally I have noticed one thing over here. For field (575,6,ZD) in the sort card the values are coming is null values (there are no values present for the field). So I am getting the SOC7 error. I tried remove the field in the sort card and i was successfull.
Sometimes the field will contain the amounts. That particular instance also i need to add the values for 575,6,ZD this field. Could you please let me know how I can achieve this by using sort.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
What do you mean by "null values"? Do you mean binary zeros or blanks or what? Show one of the "null values" in hex. Or do you mean that the VSAM record is shorter than 576 bytes?
Quote:
I tried remove the field in the sort card and i was successfull.
It would help if you showed the statement you used to do this.
Also, are the VSAM records all the same length? If so, what is that length? Or are the VSAM records different lengths?
Frank,
this is the sort card i was used. earler there was another field 575,6,ZD. I have removed this field in the sort card and tried with the following sort card.
Code:
RECORD TYPE=F
OPTION NZDPRINT
SORT FIELDS=(10,10,CH,A,83,17,CH,A)
SUM FIELDS=(118,10,ZD,336,10,ZD,581,10,ZD)
In file there are blanks for the field 575,6.
the hex format is like this.
Code:
000000
00000C
Quote:
do you mean that the VSAM record is shorter than 576 bytes?