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

Getting Error using IFTHEN with BUILD


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

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Thu Nov 29, 2007 9:25 pm
Reply with quote

My input is the following 21 byte records:

Code:

#TSUSER  IS2394  0102
CICS010  $1XXX   0102
CICS647  PZCH3   0203
DFLTGRP1 IS2394  0102
QKMTBR   IS2394  0102


The 0102 records should output 3 records per 1 records of input. The 0203 record should output 1 record per 1 record of input. The output should be an 80 byte record. I have defined the COMBINE DD statement as FB,80,27920.

Code:

 AU IS2394
 RE IS2394   GROUP(#TSUSER )
 DU IS2394
 AU $1XXX
 RE $1XXX    GROUP(CICS010 )
 DU $1XXX
 CO PXCH3    GROUP(CICS647 )
 AU IS2394
 RE IS2394   GROUP(DFLTGRP1)
 DU IS2394
 AU IS2394
 RE IS2394   GROUP(QKMTBR  )
 DU IS2394
 


Here are the ICETOOL control cards I am attempting to use:

Code:

SORT FIELDS=COPY                                               
OUTFIL FNAMES=COMBINE,IFOUTLEN=80,                             
    IFTHEN=(WHEN=(18,4,CH,EQ,C'0203'),                         
    BUILD=(1:C' CO ',5:8,10,13:C' GROUP(',20:8,1,28:C')',       
          29:52C' ')),                                         
    IFTHEN=(WHEN=(18,4,CH,EQ,C'0102'),                         
    BUILD=(1:C' AU ',5:8,10,13:68C' ',/,                       
    1:C' RE ',5:8,10,13:C' GROUP(',20:8,1,28:C')',29:52C' ',/, 
    1:C' DU ',5:8,10,13:68C' '))                               


Here is the error message I am receiving.

Code:

ICE146I 0 END OF STATEMENTS FROM CTL3CNTL - PARAMETER LIST STATEMENTS FOLLOW   
          DEBUG NOABEND,ESTAE                                                   
          OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CTL3,SORTIN=TEMP2
                         SORTOUT=COMBINE,DYNALLOC                               
ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1                         
ICE126A 9 INCONSISTENT COMBINE  IFTHEN 2 REFORMATTING FIELD FOUND               
ICE751I 0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 E9-K90007 E7-K24705           
ICE052I 3 END OF DFSORT                                                         


Any assistance would be greatly appreciated.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Nov 29, 2007 10:13 pm
Reply with quote

The error message is issued because you have overlapping output fields. For example:

BUILD=(1:C' AU ',5:8,10,13:68C' ',/

The second field starts at position 5 and ends at position 14, but you have 13: for the next output field which overlaps the previous field. It looks like you reversed the starting position and length for the second field - you specified 8,10 when you really wanted 10,8. You reversed 1,8 to 8,1 as well.

Here are simplied DFSORT control statements that will do what you want:

Code:

  SORT FIELDS=COPY                                               
  OUTFIL FNAMES=COMBINE,IFOUTLEN=80,                             
    IFTHEN=(WHEN=(18,4,CH,EQ,C'0203'),                           
      BUILD=(1:C' CO ',5:10,8,13:C' GROUP(',20:1,8,28:C')')),   
    IFTHEN=(WHEN=(18,4,CH,EQ,C'0102'),                           
      BUILD=(1:C' AU ',5:10,8,/,                                 
           1:C' RE ',5:10,8,13:C' GROUP(',20:1,8,28:C')',/,     
           1:C' DU ',5:10,8))                                   
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Thu Nov 29, 2007 11:28 pm
Reply with quote

The solution worked great.

Thank you very much.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Nov 29, 2007 11:44 pm
Reply with quote

Glad I could help.
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 Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Build a record in output file and rep... DFSORT/ICETOOL 11
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top