|
View previous topic :: View next topic
|
| Author |
Message |
balaji81_k
Active User
Joined: 29 Jun 2005 Posts: 155
|
|
|
|
Hi ,
I have sort card where i am moving the this-year-* data fields to last-year* data fields and reset this this-year data fields to zero and i am seeing the issue could be in reset the value zero to this-year data fields and i am not sure why it is causing the issue .
Please find the COBOL definition and SORT card :
| Code: |
01 WS-REC.
05 WS-KEY PIC S9(9) USAGE COMP.
05 THIS-YEAR-X-AMNT PIC S9(13)V9(2) USAGE COMP-3.
05 THIS-YEAR-Y-AMNT PIC S9(13)V9(2) USGAE COMP-3.
05 THIS-YEAR-X-Y-CNT PIC S9(9) COMP.
05 LAST-YEAR-X-AMNT PIC S9(13)V9(2) USAGE COMP-3.
05 LAST-YEAR-Y-AMNT PIC S9(13)V9(2) USAGE COMP-3.
05 LAST-YEAR-X-Y-CNT PIC S9(9) COMP.
05 FILLER PIC X(10).
SORT FIELDS=(1,4,BI,A)
OUTREC FIELDS=(1:1,4,25:5,8,33:13,8,41:21,4,
5:+0,TO=PD,LENGTH=8,
13:+0,TO=PD,LENGTH=8,
21:+0,TO=BI,LENGTH=4,
45:45,10)
|
Can anyone please help me on what is the issue with this sort card?. |
|
| Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
| Did you look up the reason code associated with the ICE126A message up in the manual? If not, why not start there -- ESPECIALLY since you did not bother to post that critical detail? |
|
| Back to top |
|
 |
balaji81_k
Active User
Joined: 29 Jun 2005 Posts: 155
|
|
|
|
| Robert Sample wrote: |
| Did you look up the reason code associated with the ICE126A message up in the manual? If not, why not start there -- ESPECIALLY since you did not bother to post that critical detail? |
Hi Robert,
When i read thru the error description it is found that data that is passed which is inconsistent with the format that is defined . But if if you see i have passed the data correctly according the format defined and also i have tried to pass the value for PD like X'000000000000000C' and again i got the same error .
error i got from my job
| Code: |
ICE126A 2 INCONSISTENT REFORMATTING FOR *OUTREC : REASON CODE
04 , IF THEN 0 |
|
|
| Back to top |
|
 |
balaji81_k
Active User
Joined: 29 Jun 2005 Posts: 155
|
|
|
|
| Robert Sample wrote: |
| Did you look up the reason code associated with the ICE126A message up in the manual? If not, why not start there -- ESPECIALLY since you did not bother to post that critical detail? |
Hi Robert,
I am sorry, i apologize for not putting the error message in my initial post. |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| Shouldn't that be
? |
|
| Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
| Quote: |
| it is found that data that is passed which is inconsistent with the format that is defined |
Actually, the 04 reason code does not mean this at all. From the messages manual:
| Quote: |
4.A column overlapped the previous output field in the reformatted record.
Example (fixed-length input):
INREC IFTHEN=(WHEN=INIT,
BUILD=(81:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(81,8,ZD,EQ,+1),
BUILD=(3,20,20:C'ABC'))
|
You read the first paragraph in the error manual, without looking at the reason code (or not understanding what the reason code means) and went off on a wild goose chase for inconsistent formats when your problem was something else entirely.
I took your SORT statements and rearranged them as
| Code: |
OUTREC FIELDS=(1:1,4,
5:+0,TO=PD,LENGTH=8,
13:+0,TO=PD,LENGTH=8,
21:+0,TO=BI,LENGTH=4,
25:5,8,33:13,8,41:21,4,
45:45,10) |
so there is no overlapping, and the code worked and produced an output data set. If you read the manual on the OUTREC statement, as I did, you will find that any gaps you leave in your FIELDS will be filled with spaces so you need to put the fields in ascending column sequence when coding it. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
First don't use FIELDS use BUILD.
Second, don't use columns unless you need them, which you don't here.
BUILD creates a new record, sourced from the original, so there is no need to attempt to reference fields out of order. Your code fails exactly for the reason specified by Robert.
Indeed, for this task, OVERLAY is better, where you would use columns and be concerned with the order. It uses the current record and only changes data specified in the statement. |
|
| Back to top |
|
 |
balaji81_k
Active User
Joined: 29 Jun 2005 Posts: 155
|
|
|
|
| Bill Woodger wrote: |
First don't use FIELDS use BUILD.
Second, don't use columns unless you need them, which you don't here.
BUILD creates a new record, sourced from the original, so there is no need to attempt to reference fields out of order. Your code fails exactly for the reason specified by Robert.
Indeed, for this task, OVERLAY is better, where you would use columns and be concerned with the order. It uses the current record and only changes data specified in the statement. |
Thanks Bill for your advise ,i have used BUILD instead of Fields. |
|
| Back to top |
|
 |
balaji81_k
Active User
Joined: 29 Jun 2005 Posts: 155
|
|
|
|
| Robert Sample wrote: |
| Quote: |
| it is found that data that is passed which is inconsistent with the format that is defined |
Actually, the 04 reason code does not mean this at all. From the messages manual:
| Quote: |
4.A column overlapped the previous output field in the reformatted record.
Example (fixed-length input):
INREC IFTHEN=(WHEN=INIT,
BUILD=(81:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(81,8,ZD,EQ,+1),
BUILD=(3,20,20:C'ABC'))
|
You read the first paragraph in the error manual, without looking at the reason code (or not understanding what the reason code means) and went off on a wild goose chase for inconsistent formats when your problem was something else entirely.
I took your SORT statements and rearranged them as
| Code: |
OUTREC FIELDS=(1:1,4,
5:+0,TO=PD,LENGTH=8,
13:+0,TO=PD,LENGTH=8,
21:+0,TO=BI,LENGTH=4,
25:5,8,33:13,8,41:21,4,
45:45,10) |
so there is no overlapping, and the code worked and produced an output data set. If you read the manual on the OUTREC statement, as I did, you will find that any gaps you leave in your FIELDS will be filled with spaces so you need to put the fields in ascending column sequence when coding it. |
Thanks Robert for your Quick Help and as Bill suggested i have used OUTREC BUILD instead of OUTREC FIELDS. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|