MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Splitting a Notice Print File into 4 files

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
vini
Intermediate


Joined: 12 Jan 2004
Posts: 240
Topics: 48
Location: Maryland

PostPosted: Thu Oct 20, 2011 3:49 pm    Post subject: Splitting a Notice Print File into 4 files Reply with quote

Hi Gurus,

Requirement::
Split a FB, 112 LRECL dataset. This DS to be split contains client notices.
The beginning of the set of records pertaining to a Notice contains the words 'COVER-PAGE' in column 14.
Each notice is comprised of variable number of records and the only thing consistent across the file is the word 'COVER-PAGE' at col 14 to indicate the first record of a start of a Notice.

Question::
Is there a way to do this SPLIT into 4 Files using a JCL through DFSORT or some similar utility ??? If yes, can someone please post a sample JCL.

I know this can be done through a program but if anyway possible in JCL it would be ideal.
Pls let me know if you need more information incase the requirement was not clear enough.


Thanks,
Vini
Back to top
View user's profile Send private message
vini
Intermediate


Joined: 12 Jan 2004
Posts: 240
Topics: 48
Location: Maryland

PostPosted: Thu Oct 20, 2011 3:56 pm    Post subject: Reply with quote

Example:

45,000 occurances of COVER-PAGE = 45,000 notices = (45,000 x Y) records.

Record Counts after Split:
File1: 10k
File2: 10k
File3: 10k
File4: 15k
Back to top
View user's profile Send private message
vini
Intermediate


Joined: 12 Jan 2004
Posts: 240
Topics: 48
Location: Maryland

PostPosted: Thu Oct 20, 2011 4:14 pm    Post subject: Reply with quote

vini wrote:
Example:

45,000 occurances of COVER-PAGE = 45,000 notices = (45,000 x Y) records.

Record Counts after Split:
File1: 10k
File2: 10k
File3: 10k
File4: 15k
Sorry, I meant 'Notice Counts' after Split and not 'Record Counts'.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Oct 20, 2011 4:40 pm    Post subject: Reply with quote

I'm not sure I understand what you want to do or how you want to do it.

It sounds like you have many groups of records like this:

COVER-PAGE
record 1
record 2
record 3
COVER-PAGE
record 4
record 5
record 6
record 7
...

and you want to split all of the input records into 4 output input files, but make sure a COVER-PAGE group is NOT split between output files ... is that correct?

Do you have a particular number of records in mind for the split (like 10K) or did you want that determined from the total number of records divided by 4?

Why did you pick 10K, 10K, 10K, 15K for the number of records in each output file?
Why not 450000/4 = 11250 records per output file or something closer to that?

Will you always have 45000 input records or can the number vary?

How exactly do you want the split done if your given number of records does not contain complete groups? For example, what if the first 3 groups had 5000, 3000 and 4000 records? Would you want 5000+3000 in output file1 or 5000+3000+4000 in output file1? What are the rules for splitting the groups?
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vini
Intermediate


Joined: 12 Jan 2004
Posts: 240
Topics: 48
Location: Maryland

PostPosted: Thu Oct 20, 2011 4:51 pm    Post subject: Reply with quote

Yes Frank, that is correct ! The split files should contain entire Notices and not partial. Also you understood right that each notice could have variable number of records based on the nature of the clients case.

Total number of NOTICES to be determined = Total COVER-PAGE occurance / 4.

My mistake, I assumed 45K was not divisible by 4 bonk

The number of Notice or corresponding number of Records on original file will always vary and is not limited to 45k. The example was put to indicate that if the number of notices is not evenly divisble by 4 then the excess can be put in File4.

Sorry for the confusion.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Oct 20, 2011 5:53 pm    Post subject: Reply with quote

This type of dynamic split by group task is rather tricky to do, but I've taken a shot at it below. See if this 3 step DFSORT/ICETOOL job gives you what you want:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB/112)
//SORTOUT DD DSN=&&S0,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
  INREC BUILD=(SEQNUM,8,ZD)
  SORT FIELDS=(1,8,ZD,D)
  OUTREC BUILD=(1,8,ZD,DIV,+4,TO=ZD,LENGTH=8)
  OUTFIL REMOVECC,ENDREC=1,
    BUILD=(C'TARG1,+',1,8,80:X,/,
           C'TARG2,+',1,8,ZD,MUL,+2,TO=ZD,LENGTH=8,/,
           C'TARG3,+',1,8,ZD,MUL,+3,TO=ZD,LENGTH=8)
/*
//S2    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S0,DISP=(OLD,PASS)
//SYMNOUT DD SYSOUT=*
//IN DD DSN=...  input file (FB/112)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//SPL1 DD DSN=&&S1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//SPL2 DD DSN=&&S2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//SPL3 DD DSN=&&S3,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//TOOLIN   DD    *
COPY FROM(IN) USING(CTL0)
COPY FROM(T2) TO(SPL1) USING(CTL1)
COPY FROM(T2) TO(SPL2) USING(CTL2)
COPY FROM(T2) TO(SPL3) USING(CTL3)
//CTL0CNTL DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(14,10,CH,EQ,C'COVER-PAGE'),
     PUSH=(121:ID=8))
  OUTFIL FNAMES=T1,OVERLAY=(113:SEQNUM,8,ZD)
  OUTFIL FNAMES=T2,NODETAIL,REMOVECC,
    BUILD=(80X),
    SECTIONS=(121,8,
      TRAILER3=(SUBCOUNT=(M11,LENGTH=8)))
//CTL1CNTL DD *
  INCLUDE COND=(1,8,ZD,GE,TARG1)
  OPTION STOPAFT=1
  OUTREC BUILD=(C'SPL1,+',1,8,80:X)
//CTL2CNTL DD *
  INCLUDE COND=(1,8,ZD,GE,TARG2)
  OPTION STOPAFT=1
  OUTREC BUILD=(C'SPL2,+',1,8,80:X)
//CTL3CNTL DD *
  INCLUDE COND=(1,8,ZD,GE,TARG3)
  OPTION STOPAFT=1
  OUTREC BUILD=(C'SPL3,+',1,8,80:X)
/*
//S3  EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//         DD DSN=&&S2,DISP=(OLD,PASS)
//         DD DSN=&&S3,DISP=(OLD,PASS)
//SYMNOUT DD SYSOUT=*
//SORTIN DD DSN=&&T1,DISP=(OLD,PASS)
//OUT1 DD DSN=...  output file1 (FB/112)
//OUT2 DD DSN=...  output file2 (FB/112)
//OUT3 DD DSN=...  output file3 (FB/112)
//OUT4 DD DSN=...  output file4 (FB/112)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL FNAMES=OUT1,
    INCLUDE=(113,8,ZD,LE,SPL1),
    BUILD=(1,112)
  OUTFIL FNAMES=OUT2,
    INCLUDE=(113,8,ZD,GT,SPL1,AND,113,8,ZD,LE,SPL2),
    BUILD=(1,112)
  OUTFIL FNAMES=OUT3,
    INCLUDE=(113,8,ZD,GT,SPL2,AND,113,8,ZD,LE,SPL3),
    BUILD=(1,112)
  OUTFIL FNAMES=OUT4,SAVE,
    BUILD=(1,112)
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vini
Intermediate


Joined: 12 Jan 2004
Posts: 240
Topics: 48
Location: Maryland

PostPosted: Thu Oct 20, 2011 9:13 pm    Post subject: Reply with quote

Hi Frank,

Job is returning an RC of 16 on Step2 as follows.

Code:
ICE200I 0 IDENTIFIER FROM CALLING PROGRAM IS 0001                               
ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                                 
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 0 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 21:59 ON THU OCT
            OPTION COPY                                                         
            INREC IFTHEN=(WHEN=GROUP,BEGIN=(14,16,CH,EQ,C'COVER-PAGE-START'),   
                               $                                               
ICE007A 0 SYNTAX ERROR                                                         
               PUSH=(121:ID=8))                                                 
               $                                                               
ICE005A 0 STATEMENT DEFINER ERROR                                               
            OUTFIL FNAMES=T1,OVERLAY=(113:SEQNUM,8,ZD)                         
            OUTFIL FNAMES=T2,NODETAIL,REMOVECC,                                 
              BUILD=(80X),                                                     
              SECTIONS=(121,8,         


Pls let me know what I can do to resolve this error, if possible.


Thanks,
Vini
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Oct 21, 2011 12:34 pm    Post subject: Reply with quote

My job works fine on supported releases of DFSORT.

You are using z/OS DFSORT V1R5 which is NOT a supported release of DFSORT. And besides that you are using a downlevel version of V1R5 which doesn't support WHEN=GROUP.

You need to move to a supported release of DFSORT - z/OS DFSORT V1R10 for z/OS 1.10-1.11 or z/OS DFSORT V1R12 for z/OS 1.12-1.13. I can't help you with an unsupported release.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group