|
|
| Author |
Message |
JayC
Active User
Joined: 27 Sep 2008 Posts: 58
|
|
|
|
Hi,
I am trying to SUM up 2 COMP-3 fields in my input file. The sort card I am using is as follows :
CODE :
SORT FIELDS=(8,2,CH,A)
SUM FIELDS=(214,5,PD,219,5,PD)
OUTREC FIELDS=(1,5,PD,M2,3X,10,5,PD,M2)
But I am getting a S0C7 error from the SORT
Please tell me how I can sum up the 2 consecutive fields which have the following definition :
PIC S9(7)V9(2) USAGE COMP-3.
PIC S9(7)V9(2) USAGE COMP-3.
Thanks |
|
| Back to top |
|
 |
References
|
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 691
|
|
|
|
Hi,
can you check that cols 214-218 and 219-223 are comp-3 fields?
Is the file VB or FB ?
Gerry |
|
| Back to top |
|
 |
JayC
Active User
Joined: 27 Sep 2008 Posts: 58
|
|
|
|
| gcicchet wrote: |
Hi,
can you check that cols 214-218 and 219-223 are comp-3 fields?
Is the file VB or FB ?
Gerry |
Yup, They are COMp-3 fields. I checked the Copybook, and the input file is FB. |
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 691
|
|
|
|
Hi,
can you check the actual data and show an example ?
Gerry |
|
| Back to top |
|
 |
Skolusu
DFSORT Developer
Joined: 07 Dec 2007 Posts: 399 Location: San Jose
|
|
|
|
JayC,
Your job is failing because your input does not have valid Packed decimal fields. You can run VERIFY on the PD fields to see which records have invalid data.
Run the following to check for the invalid packed decimal fields
| Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
//OUT DD SYSOUT=*
//TOOLIN DD *
VERIFY FROM(IN) ON(214,5,PD) ON(219,5,PD)
/* |
Check this DFSORT/ICETOOL link which explains in detail about the VERIFY operator
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA10/6.16?DT=20050222160456 |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4683 Location: San Jose, CA
|
|
|
|
JayC,
| Code: |
SORT FIELDS=(8,2,CH,A)
SUM FIELDS=(214,5,PD,219,5,PD)
OUTREC FIELDS=(1,5,PD,M2,3X,10,5,PD,M2)
|
I'd guess the S0C7 is caused by the OUTREC statement, not the SUM statement.
You are summing on positions 214-218 and 219-223, but in your OUTREC statement you are NOT using those fields. Instead, you're using 1-5 and 10-14 which I suspect DO NOT have PD values, thus causing the S0C7.
SUM doesn't move the fields so they're still at 214 and 219. I don't know why you're using 1 and 10. If you're trying to output the summed fields, then you want this OUTREC statement:
| Code: |
OUTREC BUILD=(214,5,PD,M2,3X,219,5,PD,M2)
|
If you're trying to do something with PD fields at 1 and 10 in the input record, then why are you bothering to do the SUM on the other fields when you aren't going to output them? |
|
| Back to top |
|
 |
JayC
Active User
Joined: 27 Sep 2008 Posts: 58
|
|
|
|
Skolusu & Frank,
Thanks alot . It works now !
Frank you were right about the OUTREC statement, my mistake.
And Skolusu thanks for the info on the VERIFY operator... Thats something new to me...
Again... Thank you. |
|
| Back to top |
|
 |
|
|
|