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 

Build Include based on input parameters

 
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
satya_mn_99
Beginner


Joined: 26 Sep 2005
Posts: 17
Topics: 5

PostPosted: Mon Jan 23, 2006 10:12 am    Post subject: Build Include based on input parameters Reply with quote

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.

Thanks.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon Jan 23, 2006 10:17 am    Post subject: Reply with quote

satya_mn_99,

Post a sample input and desired output along with the DCB properties of the files.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
satya_mn_99
Beginner


Joined: 26 Sep 2005
Posts: 17
Topics: 5

PostPosted: Mon Jan 23, 2006 10:23 am    Post subject: Reply with quote

Input File 1:

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.

BKUP.G0002V00
BKUP.G0003V00
BKUP.G0004V00
BKUP.G0005V00
BKUP.G0006V00

Please let me know if this is confusing you. Thanks for your help on this.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon Jan 23, 2006 10:33 am    Post subject: Reply with quote

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.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
satya_mn_99
Beginner


Joined: 26 Sep 2005
Posts: 17
Topics: 5

PostPosted: Mon Jan 23, 2006 10:37 am    Post subject: Reply with quote

Yes it is part of the Data.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon Jan 23, 2006 10:59 am    Post subject: Reply with quote

Quote:

Yes it is part of the Data.

satya_mn_99,

use file2 to create the symbols(step0100) and use the created symbols dataset in Step0200 to filter the records.

Ex:

Code:

//STEP0100 EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD *                                             
2005-10-01 2005-10-05                                       
//SORTOUT  DD DSN=&S,DISP=(,PASS),SPACE=(CYL,(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 *                                             
2005-10-01                                                   
2005-10-02                                                   
2005-10-03                                                   
2005-10-04                                                   
2005-11-05                                                   
2005-10-06                                                   
2005-10-07                                                   
2005-10-08                                                   
//SORTOUT  DD SYSOUT=*                                       
//SYSIN    DD    *                                           
  SORT FIELDS=COPY                                           
  INCLUDE COND=(1,10,CH,GE,STARTDATE,AND,1,10,CH,LE,ENDDATE)
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
satya_mn_99
Beginner


Joined: 26 Sep 2005
Posts: 17
Topics: 5

PostPosted: Mon Jan 23, 2006 11:30 am    Post subject: Reply with quote

Hi Kolusu,

It is working perfectly as I wanted it. Thanks a lot for your help on this.

I have another question here.


I have a step like this :

//STEP0600 EXEC PGM=SORT
//*
//SORTIN DD DSN=&OUTPUT,
// DISP=OLD
//SORTOUT DD DSN=FV99P.ABCD.OUTPUT,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(100,10),RLSE),
// LRECL=3500,
// RECFM=FB
//*
//SYSIN DD *
SORT FIELDS=COPY
/*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*


The &Output contains :

ABCD.DLY.XYZ10.BKUP.G0002V00
ABCD.DLY.XYZ10.BKUP.G0003V00

I want to concatenate the above 2 version data and copy into

FV99P.ABCD.OUTPUT. Please advice.

Pls let me know if the question is not having clarity.

Thanks in advance
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon Jan 23, 2006 11:44 am    Post subject: Reply with quote

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.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
satya_mn_99
Beginner


Joined: 26 Sep 2005
Posts: 17
Topics: 5

PostPosted: Mon Jan 23, 2006 11:49 am    Post subject: Reply with quote

Hi,

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


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Tue Jan 24, 2006 5:50 am    Post subject: Reply with quote

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.

Thanks,

Phantom
Back to top
View user's profile Send private message
satya_mn_99
Beginner


Joined: 26 Sep 2005
Posts: 17
Topics: 5

PostPosted: Tue Jan 24, 2006 9:31 am    Post subject: Reply with 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.


Hope this is clear now. please advise.
Back to top
View user's profile Send private message
German Castillo
Beginner


Joined: 23 Dec 2005
Posts: 83
Topics: 2
Location: Caracas, Venezuela

PostPosted: Tue Jan 24, 2006 10:46 am    Post subject: Reply with quote

Why don't you just post your input data as well as your desired output?
_________________
Best wishes,

German Castillo
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Jan 24, 2006 12:16 pm    Post subject: Reply with quote

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.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
satya_mn_99
Beginner


Joined: 26 Sep 2005
Posts: 17
Topics: 5

PostPosted: Thu Jan 26, 2006 3:59 pm    Post subject: Reply with quote

Hi Kolusu,

It's wonderful, awesome solution you gave us. It really unbeleivable !!!!

Thanks and sorry about the confusion.
Back to top
View user's profile Send private message
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