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

Split File in multiple and attaching Header and Trailer


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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Nov 16, 2012 1:44 am
Reply with quote

Hello,

Does this not bring you back to what Kolusu posted weeks ago?
Quote:
Thank you for your timely feed back and I am extremely sorry that I canNOT help you create something that doesn't exist.


Creating the dummy records should leave you with no codes without records.

If there is only a dummy record for a given code, that could be used to identify the codes with "no records". Possibly if you create a dummy record even for the codes with records, then when the record count for a code is 1 this code really has no records?
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: Fri Nov 16, 2012 6:43 am
Reply with quote

OK. This is a good example of the time wasted when the requirement is not fully described.

Your current control cards are not working because the HEADER1 is relying on the content of the first record output, and there isn't a first record output when there are no records.

Then, when adding JOIN UNPAIRED,F2 to get the dummies-matching-no-data the TRAILER, which is counting the records, no longer works as-is.

So, we have to make some extensive changes.

The header is now written not by HEADER1 but by using the / (slash operator) it is written before the first actual record. This requires the addition of a sequence number then tested for one. The unmatched dummy record also causes the header to be written, but with no dummy record written (obviously). The TRAILER1 is amended to make use of the count from the "header" which is on all the REFORMAT records via the processing in the JNF2CNTL.

The JNF2CNTL is amended to include a GROUP with only one record, which identifies the DUMMY records and takes the 0 mentioned below and PUSHes it over the 1 set by the WHEN=INIT so that the dummy records are not counted when it comes to the SUM.

The DUMMY records are to look something like this, single records with the A1, A2 and A3 starting in column 79:

Code:
DUMMY RECORD COUNT TO BE 0 (ZERO)                                             A1
DUMMY RECORD COUNT TO BE 0 (ZERO)                                             A2
DUMMY RECORD COUNT TO BE 0 (ZERO)                                             A3


The 0 in the above is used, so if the position of the 0 is changed, you have to make the code reflect that.

It has been lightly tested. First make sure you understand it and that it meets all your requirements. Then test it thoroughly. Then enjoy applying the changes for 50 OUTFILs and testing it thoroughly again (lots of scope for typos/editos).

Code:
  OPTION COPY     
  JOINKEYS F1=INA,FIELDS=(79,2,A)
  JOINKEYS F2=INB,FIELDS=(79,2,A)
  JOIN UNPAIRED,F2
  REFORMAT FIELDS=(F1:1,80,F2:1,88,?)
  INREC OVERLAY=(105:161,8)
                                                             
                                                             
  OUTFIL FNAMES=A1,REMOVECC,INCLUDE=(79,2,CH,EQ,C'A1',
                                   OR,(169,1,CH,EQ,C'2',
                                      AND,159,2,CH,EQ,C'A1')),
                   TRAILER1=('TRAILER',105,8),
     IFTHEN=(WHEN=INIT,OVERLAY=(170:SEQNUM,8,ZD)),
     IFTHEN=(WHEN=(169,1,CH,EQ,C'2'),
         BUILD=(81,78)),
     IFTHEN=(WHEN=(170,8,ZD,EQ,1),
         BUILD=(81,78,/,1,78)),
     IFTHEN=(WHEN=NONE,
         BUILD=(1,78))
                                                             
  OUTFIL FNAMES=A2,REMOVECC,INCLUDE=(79,2,CH,EQ,C'A2',
                                   OR,(169,1,CH,EQ,C'2',
                                      AND,159,2,CH,EQ,C'A2')),
  TRAILER1=('TRAILER',105,8),
     IFTHEN=(WHEN=INIT,OVERLAY=(170:SEQNUM,8,ZD)),
     IFTHEN=(WHEN=(169,1,CH,EQ,C'2'),
         BUILD=(81,78)),
     IFTHEN=(WHEN=(170,8,ZD,EQ,1),
         BUILD=(81,78,/,1,78)),
     IFTHEN=(WHEN=NONE,
         BUILD=(1,78))
                                                             
  OUTFIL FNAMES=A3,REMOVECC,INCLUDE=(79,2,CH,EQ,C'A3',
                                   OR,(169,1,CH,EQ,C'2',
                                      AND,159,2,CH,EQ,C'A3')),
     IFTHEN=(WHEN=INIT,OVERLAY=(170:SEQNUM,8,ZD)),
     IFTHEN=(WHEN=(169,1,CH,EQ,C'2'),
         BUILD=(81,78)),
     IFTHEN=(WHEN=(170,8,ZD,EQ,1),
         BUILD=(81,78,/,1,78)),
     IFTHEN=(WHEN=NONE,
         BUILD=(1,78))
                                                             
//*
//JNF1CNTL DD *
   OMIT COND=(1,6,CH,EQ,C'HEADER',OR,1,7,CH,EQ,C'TRAILER')
                                                             
//*
//JNF2CNTL DD *
   OMIT COND=(1,7,CH,EQ,C'TRAILER')
   INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:7C'0',C'1')),
   IFTHEN=(WHEN=GROUP,BEGIN=(1,6,CH,EQ,C'DUMMY '),RECORDS=1,
           PUSH=(88:26,1)),
   IFTHEN=(WHEN=GROUP,BEGIN=(1,6,CH,EQ,C'HEADER'),PUSH=(1,78))
   SUM FIELDS=(81,8,ZD)
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Nov 16, 2012 8:25 am
Reply with quote

Bill,
could this not be done in two passes?
1st pass to build the control records
and the
2nd to actually execute?

that way the amount of control cards to generate for the 1st pass
would be less than the code needed to generate standard for all situations
and the generated (by 1st pass) control cards for the 2nd pass
would always be only what is needed.

if the TS manages to create that correctly,
he probably will not need to post anymore of these crazy requests.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
Search our Forums:

Back to Top