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

INREC vs OUTREC for empty input file


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

New User


Joined: 25 Oct 2007
Posts: 81
Location: Australia

PostPosted: Thu Feb 06, 2014 8:21 pm
Reply with quote

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

Code:
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)
[/quote]

Code:
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??

Thanks
Charan
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Thu Feb 06, 2014 9:13 pm
Reply with quote

How was the "empty" file created? Did you check that it was "empty"? It looks to me that you have records on the file, they are just shorter.

Code:
  OPTION COPY


Run that on your "empty" file and post the sysout from the step, please.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1586
Location: Andromeda Galaxy

PostPosted: Thu Feb 06, 2014 9:22 pm
Reply with quote

Hi Charan,

Did you see the below error??

Code:
ICE027A 5 END OF          FIELD BEYOND MAXIMUM RECORD LENGTH


Also using INREC does create empty files for an empty input
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Fri Feb 07, 2014 12:01 am
Reply with quote

Yes, you have the same in the other output, with

Code:
ICE088I 1 BIRDDM01.JS040   .        , INPUT LRECL = 100, BLKSIZE = 27900, TYPE = FB


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...
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Feb 07, 2014 6:06 am
Reply with quote

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.

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA60/1.5.4?

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.
Back to top
View user's profile Send private message
charanmsrit

New User


Joined: 25 Oct 2007
Posts: 81
Location: Australia

PostPosted: Fri Feb 07, 2014 7:22 am
Reply with quote

Thanks Bill and Kolusu,

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.
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 Get two files from one file with diff... DFSORT/ICETOOL 10
No new posts View GDG data which is copied from a ... JCL & VSAM 2
No new posts How to read unpacked field created in... DFSORT/ICETOOL 11
No new posts JCL (SET) variables in input stream data JCL & VSAM 0
No new posts How to add 2 digits to COMP-3 file? DFSORT/ICETOOL 11
Search our Forums:

Back to Top