IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

OUTREC FILELDS FAILS WITH ICE126A 2 INCONSISTENT REFORMAT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
balaji81_k

Active User


Joined: 29 Jun 2005
Posts: 155

PostPosted: Sat Jul 02, 2016 1:22 am
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Jul 02, 2016 2:51 am
Reply with quote

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
View user's profile Send private message
balaji81_k

Active User


Joined: 29 Jun 2005
Posts: 155

PostPosted: Sat Jul 02, 2016 3:22 am
Reply with quote

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
View user's profile Send private message
balaji81_k

Active User


Joined: 29 Jun 2005
Posts: 155

PostPosted: Sat Jul 02, 2016 3:37 am
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Sat Jul 02, 2016 6:52 am
Reply with quote

Shouldn't that be
Code:
45:41,10
?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Jul 02, 2016 8:51 am
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Jul 03, 2016 2:25 pm
Reply with quote

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
View user's profile Send private message
balaji81_k

Active User


Joined: 29 Jun 2005
Posts: 155

PostPosted: Tue Jul 05, 2016 9:29 pm
Reply with quote

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
View user's profile Send private message
balaji81_k

Active User


Joined: 29 Jun 2005
Posts: 155

PostPosted: Tue Jul 05, 2016 9:30 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to Reformat a file using File Man... All Other Mainframe Topics 14
No new posts Reformat and relocate content DFSORT/ICETOOL 4
No new posts dsnrexx fails without error message CLIST & REXX 9
No new posts question on Outrec and sort #Digvijay DFSORT/ICETOOL 20
No new posts Z Monitoring server fails to start IBM Tools 1
Search our Forums:

Back to Top