Tony,
It is quite easy to split the group of records into multiple members. Here
is a sample JCL which will give you the desired results of splitting the
first 999 groups of records into a PDSE each containing the group of
records. I also assumed your Input is already sorted on the field you want
to split. I assumed that the split field is 44 bytes in length. If it is
different then you can change it in ALL the places referred by KEYBEGIN.
This job creates a dynamic JCL which will then be submitted via INTRDR.
Take a look at the output from Step0200 and then if everything looks ok
then change the statement
//SORTOUT DD SYSOUT=* to //SORTOUT DD SYSOUT=(*,INTRDR),RECFM=FB
If you have more than 999 groups of records we will copy the rest of the
records into another file which will then be used as input file to further
split. I will show you how to build the dynamic JCL's based on that. I
chose the split to be 999 groups as the maximum number of DD statements
per job step is 3273, based on the number of single DD statements allowed
for a TIOT (task input output table) control block size of 64K. This limit
can be different depending on the installation defined TIOT size. The
IBM-supplied default TIOT size is 32K.
//*********************************************************************
//* BUILD DYNAMIC OUTFIL CARDS AND DDNAMES FOR EACH GROUP OF RECORDS *
//*********************************************************************
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=Your Input FB 100 Byte file
//*
//OFCARDS DD DSN=&&C,DISP=(,PASS),SPACE=(CYL,(20,20),RLSE)
//DDNAMES DD DSN=&&D,DISP=(,PASS),SPACE=(CYL,(20,20),RLSE)
//SORTOUT DD DUMMY
//SYSIN DD *
OPTION COPY,NULLOUT=RC4
OUTREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,44),PUSH=(101:ID=4))
OUTFIL FNAMES=OFCARDS,REMOVECC,NODETAIL,BUILD=(80X),
INCLUDE=(101,4,ZD,LT,1000),
SECTIONS=(101,4,
TRAILER3=(3:'OUTFIL FNAMES=OUTF',101,4,',BUILD=(1,100),',
C'INCLUDE=(101,4,ZD,EQ,',101,4,')')),
TRAILER1=(3:'OUTFIL FNAMES=NGRP',101,4,',SAVE')
OUTFIL FNAMES=DDNAMES,REMOVECC,NODETAIL,BUILD=(80X),
INCLUDE=(101,4,ZD,LT,1000),
SECTIONS=(101,4,
TRAILER3=('//OUTF',101,4,' DD ',
'DISP=SHR,DSN=Your.Split.PDSE(OUTF',101,4,')')),
TRAILER1=('//NGRP',101,4,' DD ',
'DSN=HLQ.TONYCLD.NGRP',101,4,','/,
'//',15:'DISP=(NEW,CATLG,DELETE),',/,
'//',15:'SPACE=(CYL,(100,40),RLSE)',/,
'//*')
//*
//*********************************************************************
//* SUBMIT THE SPLIT JOB TO INTRDR WITH THE ABOVE OUTPUT *
//*********************************************************************
//STEP0200 EXEC PGM=SORT,COND=(4,EQ,STEP0100)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
//*SORTOUT DD SYSOUT=(*,INTRDR),RECFM=FB
//SORTOUT DD SYSOUT=*
//SORTIN DD DATA,DLM=$$
//SPLTTONY JOB (DA26,001,098,J69),'TONY',
// CLASS=A,
// MSGCLASS=H,
// MSGLEVEL=(1,1),
// TIME=(,15),
// NOTIFY=USERID
//*
//SPLTSTEP EXEC PGM=SORT,REGION=0M
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=Your Input FB 100 Byte file
$$
// DD DSN=&D,DISP=(OLD,PASS)
// DD DATA,DLM=$$
//SYSIN DD *
OPTION COPY,ODMAXBF=100K
OUTREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,44),PUSH=(101:ID=4))
$$
// DD DSN=&C,DISP=(OLD,PASS)
//*
Further if you have any questions please let me know
Thanks,
Kolusu
DFSORT Development
IBM Corporation
IBM Mainframe Discussion List <[email protected]> wrote on
08/20/2014 07:34:48 AM:
> From: TonyIcloud-OPERA <[email protected]>
> To: [email protected]
> Date: 08/20/2014 07:35 AM
> Subject: DF/SORT question (challenge?)
> Sent by: IBM Mainframe Discussion List <[email protected]>
>
> I have a dataset that contains records with a field, by which I need to
> create a separate dataset that would contain all occurrences of that
> field. For example the file, FB100, looks like
>
> value1 other data.....
> value1 other data.....
> value1 other data.....
> value2 other data.....
> value2 other data.....
> value2 other data.....
> value3 other data.....
> value3 other data.....
> value3 other data.....
> value4 other data.....
> value4 other data.....
> value4 other data.....
>
> My final product must be a series of datasets:
>
> hlq.value1.records
> hlq.value2.records
> hlq.value3.records
> hlq.value4.records
>
> There may be hundreds/thousands of possible values, hence
> hundreds/thousands of datasets. I have accomplished this in 3 phases,
> first pass reads the data, uses ICETOOL OCCUR to list the values, second
> phase reads the OUTPUT and formats DD statements and OUTFIL OUTREC
> statements, the third phase reads the original data to create the
numerous
> output files. I used a newly created PDSE as the output file whereupon
> the third phase created several thousand members.
>
> It works, after a fashion, but I'd like a more simple solution.
>
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN