i have built the below cards to retain the order, sort based on two fields and then split them into five files. i need to process the records in the order they come but the sort is ensuring that for the same key the records are not split into multiple files (to avoid DB deadlocks while parallel processing). now during my testing, the input to this step was empty and therefore it fails
ICE200I 0 IDENTIFIER FROM CALLING PROGRAM IS 0001
ICE805I 0 JOBNAME: BIRDDM01 , STEPNAME: JS040
ICE802I 0 BLOCKSET TECHNIQUE IN CONTROL
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE027A 5 END OF FIELD BEYOND MAXIMUM RECORD LENGTH
ICE751I 0 C5-K76982 C6-K90026 C7-K58148
C8-K67572 E9-K60824 E7-K79990
ICE143I 0 BLOCKSET SORT TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort
FOR DFSORT PAPERS, EXAMPLES AND MORE
ICE000I 0 - CONTROL STATEMENTS FOR 5694-A01,
Z/OS DFSORT V1R12 - 01:28 ON FRI FEB 07, 2014 -
OPTION EQUALS
SORT FIELDS=(59,8,ZD,A,168,23,ZD,A)
OUTREC IFTHEN=(WHEN=GROUP,
KEYBEGIN=(168,23),PUSH=(2664:ID=1))
OUTFIL FILES=01,INCLUDE=(2664,1,SS,EQ,C'0,1'),BUILD=(1,2663)
OUTFIL FILES=02,INCLUDE=(2664,1,SS,EQ,C'2,3'),BUILD=(1,2663)
OUTFIL FILES=03,INCLUDE=(2664,1,SS,EQ,C'4,5'),BUILD=(1,2663)
OUTFIL FILES=04,INCLUDE=(2664,1,SS,EQ,C'6,7'),BUILD=(1,2663)
OUTFIL FILES=05,SAVE,BUILD=(1,2663)
ICE146I 0 END OF STATEMENTS FROM CTL1CNTL - PARAMETER LIST STATEMENTS FOLLOW
DEBUG NOABEND,ESTAE
OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,
SORTDD=CTL1,SORTIN=X77428*
3I,DYNALLOC
SORT FIELDS=COPY
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE027A 5 END OF FIELD BEYOND MAXIMUM RECORD LENGTH
ICE751I 0 C5-K76982 C6-K90026 C7-K58148 C8-K67572 E9-K60824 E7-K79990
ICE052I 3 END OF DFSORT
if i change the OUTREC above as INREC, it works absolutely fine. INREC doesn't serve the purpose and i need the 5 output files created even if they are empty so that the process continues further. Any guidance on how i can achieve my requirement within the same control card??
File not closed does sound likely. These days, Language Environment mainly takes care of things like that, but perhaps Hogan is not availing itself of that (too old, or just not using it).
If you can't get a change, you'll have to come up with a reliable way of dealing with it...
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
charanmsrit wrote:
Hi All,
i have built the below cards to retain the order, sort based on two fields and then split them into five files. i need to process the records in the order they come but the sort is ensuring that for the same key the records are not split into multiple files (to avoid DB deadlocks while parallel processing). now during my testing, the input to this step was empty and therefore it fails
if i change the OUTREC above as INREC, it works absolutely fine.
charanmsrit,
Your Empty input file has no relevance to your Job failure. Your job with OUTREC failed due to the SORT statement. You need to understand the flow of DFSORT. Check this link which shows the processing order for record handling, exits, statements, and options. Use this diagram with the text following it to understand the order DFSORT uses to run your job.
Your SORT statement gets executed before OUTREC statement and when your input file LRECL in only 100 bytes and you are trying to sort the value at 168 for length of 23 bytes which does NOT exist and hence the error ICE027A.
When you used INREC statement, it gets executed before SORT statement and hence your job was successful. Even though your LRECL is only 100, and your WHEN=GROUP is validating the field at 168, DFSORT actually replaces missing bytes with spaces in specified input fields and are processed as padded fields and hence your job was successful.
charanmsrit wrote:
INREC doesn't serve the purpose and i need the 5 output files created even if they are empty so that the process continues further. Any guidance on how i can achieve my requirement within the same control card??
You need to first tell us the reason as to why you are creating a 100 byte file and trying to validate a field(position 168) that doesn't exist. If your input file is empty do you create with an LRECL=100 and if it has data do you create with an LRECL=2663?
Depending on that answer we can suggest you a solution.
My mistake. The vendor hogan package is such that the file DD DCB's are defined in a dictionary which takes precdence over JCL DCB parameters.the dictionary has the LRECL=2663 whereas the JCL has been incorrectly coded with LRECL=100. As the application did not issue a open/write/close to the file, the JCL parameter of LRECL=100 took over.