Posted: Mon Jan 23, 2006 10:12 am Post subject: Build Include based on input parameters
Hi,
I have a input file having 2 dates( From Date & To Date), I need to select the data based on these two dates using Include Statement. Please help on this.
BKUP.G0001V00 IS CREATED ON: 2005-08-12
BKUP.G0002V00 IS CREATED ON: 2005-10-02
BKUP.G0003V00 IS CREATED ON: 2005-10-02
BKUP.G0004V00 IS CREATED ON: 2005-10-03
BKUP.G0005V00 IS CREATED ON: 2005-10-04
BKUP.G0006V00 IS CREATED ON: 2005-10-05
BKUP.G0007V00 IS CREATED ON: 2005-10-06
BKUP.G0008V00 IS CREATED ON: 2005-10-07
BKUP.G0009V00 IS CREATED ON: 2005-10-08
BKUP.G0010V00 IS CREATED ON: 2005-10-09
Input File 2:
2005-10-01 2005-10-05
Output should be :
based on File 2 dates we need to select the files.
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Mon Jan 23, 2006 10:33 am Post subject:
satya_mn_99,
Does the file contain the date it was created as part of the data? If the date is not part of the data then your option is to have a cobol program call IDCAMS and then parse the output and determine the date creation and then dynamically allocate the files using BPXWDYN.
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Mon Jan 23, 2006 11:44 am Post subject:
Satya_mn_99,
You are confusing us with 2 different requests. If your input gdg's has date as part of the data, then simply give the gdg base and then the include card will pull only the data between the range.
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
Posted: Tue Jan 24, 2006 5:50 am Post subject:
satya_mn_99,
Quote:
We can now forget about the Date. I have successfully extracted the required GDG's and I want to concatenate the date into a single Dateset.
Is that clear now ? Please advise.
Nope. I am still not clear as to what you want. You give the GDG base as input and extract based on date, you will get a single dataset in SORTOUT which contains all records (from all gdg versions) which satisfies a particular date range.
Or, if you have extracted the data from every single gdg version separately, then you can write one more step to concantentate all output datasets using a sort step.
Now, tell us if your requirement is different from any of the scenarios mentioned above.
I will give the GDG base and using LIST CAT and other SORT steps I extract few GDG version based on the date criteria. Those GDG versions will be saved in a output dataset and I need the data of those versions in a single dataset.
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Tue Jan 24, 2006 12:16 pm Post subject:
Quote:
Here is the actual scenario :
I will give the GDG base and using LIST CAT and other SORT steps I extract few GDG version based on the date criteria. Those GDG versions will be saved in a output dataset and I need the data of those versions in a single dataset.
satya_mn_99,
*Sigh* you need to able to define your requirements properly. This is my best intrepretaion to my ability from the details you provided.
Try this job. This job will generate dynamic JCL taking the GDG's into account. Once the job is completed take a look at the output from step0300. If the generated JCL looks right then change the following statement in step0300
Code:
//SORTOUT DD SYSOUT=*
to
Code:
//SORTOUT DD SYSOUT=(*,INTRDR)
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
2005-10-01 2005-10-05
//SORTOUT DD DSN=&S,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL OUTREC=(C'STARTDATE',C',''',01,10,C'''',/,
C'ENDDATE',C',''',12,10,C'''',80:X)
//*
//STEP0200 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&S,DISP=OLD
//SORTIN DD *
BKUP.G0001V00 IS CREATED ON: 2005-08-12
BKUP.G0002V00 IS CREATED ON: 2005-10-02
BKUP.G0003V00 IS CREATED ON: 2005-10-02
BKUP.G0004V00 IS CREATED ON: 2005-10-03
BKUP.G0005V00 IS CREATED ON: 2005-10-04
BKUP.G0006V00 IS CREATED ON: 2005-10-05
BKUP.G0007V00 IS CREATED ON: 2005-10-06
BKUP.G0008V00 IS CREATED ON: 2005-10-07
BKUP.G0009V00 IS CREATED ON: 2005-10-08
BKUP.G0010V00 IS CREATED ON: 2005-10-09
//CARD1 DD DSN=&C1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//CARD2 DD DSN=&C2,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(30,10,CH,GE,STARTDATE,AND,30,10,CH,LE,ENDDATE)
OUTFIL FNAMES=CARD1,ENDREC=1,
OUTREC=(C'//SORTIN DD DISP=SHR,DSN=',1,14,80:X)
OUTFIL FNAMES=CARD2,STARTREC=2,
OUTREC=(C'// DD DISP=SHR,DSN=',1,14,80:X)
//*
//STEP0300 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
//SORTOUT DD SYSOUT=*
//SORTIN DD DATA,DLM=$$
//USERIDA JOB 'COPY',
// CLASS=A,
// MSGCLASS=Y,
// MSGLEVEL=(1,1),
// NOTIFY=&SYSUID
//*
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTOUT DD DSN=YOUR OUTPUT FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
//*
$$
// DD DSN=&C1,DISP=(OLD,PASS)
// DD DSN=&C2,DISP=(OLD,PASS)
//*
Tip: the length of a file name is a max of 44 characters , so your input file in step0200 should have the entire file name for 44 bytes. Here in this example I only considered 14 bytes as you have shown only that portion.
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