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 

Name a Dataset from Current Month!

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


Joined: 09 Jan 2003
Posts: 15
Topics: 6

PostPosted: Wed Apr 09, 2003 12:17 am    Post subject: Name a Dataset from Current Month! Reply with quote

Folks,
I have a bizarre requirement on hand, i am doing a Backup of load modules in our system. The job generates a list of all Loads that are to be backed up(using a Vendor tool), and then takes a backup onto a GDG Generation (PDS).
Now, i want to eliminate the use of GDG and go for a PDS with the naming format - P.**.APR2003 for the Month of April, these job would run every month, so they would be followed by MAY2003 etc..

Can this be done using JCL or any other means?Please Help!

-the enigma
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Apr 09, 2003 9:22 am    Post subject: Reply with quote

Enigma,

The following DFSORT/ICETOOL jcl will give you the desired results. If you have syncsort at your shop then change the program name to SYNCTOOL. A brief explanation of the job.

The first copy operator gets the system date in the format MM/DD/CCYY.
The second copy operator takes in that date and creates the whole copy step using IEBCOPY Which will submit the job to the INTRDR


Code:

//STEP0100 EXEC PGM=ICETOOL                                           
//*                                                                     
//TOOLMSG   DD SYSOUT=*                                                 
//DFSMSG    DD SYSOUT=*                                                 
//NULL      DD *
//DATE      DD DSN=&D,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)               
//OUT       DD SYSOUT=(*,INTRDR),RECFM=FB                               
//TOOLIN    DD *                                                       
  COPY FROM(NULL) USING(CTL1)                                           
  COPY FROM(DATE) USING(CTL2)                                           
//CTL1CNTL  DD *                                                       
  OUTFIL FNAMES=DATE,HEADER1=(DATE=(MD4/))                               
//CTL2CNTL  DD *                                                       
  INREC FIELDS=(2,2,CHANGE=(3,C'01',C'JAN',                             
                             C'02',C'FEB',                             
                             C'03',C'MAR',                             
                             C'04',C'APR',                             
                             C'05',C'MAY',                             
                             C'06',C'JUN',                             
                             C'07',C'JUL',                             
                             C'08',C'AUG',                             
                             C'09',C'SEP',                             
                             C'10',C'OCT',                             
                             C'11',C'NOV',                             
                             C'12',C'DEC'),                             
                             NOMATCH=(1,2),8,4)                         
  OUTFIL FNAMES=OUT,                                                     
  OUTREC=(C'//TID-NO-Z JOB ',X'7D',C'CREATE DSN',X'7D',C',CLASS=A,',/,   
         C'//',13X,C'MSGCLASS=Y,MSGLEVEL=(1,1),',/,                     
         C'//',13X,C'NOTIFY=&SYSUID',/,
         C'//STEP010  EXEC PGM=IEBCOPY,REGION=1024K',/,           
         C'//SYSPRINT DD SYSOUT=*',/,                             
         C'//I1       DD DSN=YOUR INPUT PDS,',/,                 
         C'//            DISP=SHR',/,                             
         C'//O1       DD DSN=P.*.*.',1,7,C',',/,             
         C'//            DISP=(NEW,CATLG,DELETE),',/,             
         C'//            UNIT=SYSDA,',/,                           
         C'//            SPACE=(CYL,(20,20,60),RLSE),',/,           
         C'//            DCB=(LRECL=ZZZ,RECFM=FB,BLKSIZE=0)',/,   
         C'//SYSIN    DD *',/,                                     
         C'COPY1 C O=O1,I=((I1,R))',/,                             
         C'//*',80:X)                                                                               


The out put of this job looks like this which is another job which will be submitted to the INTRDR

Code:

//TID-NO-Z JOB 'CREATE DSN',CLASS=A,                   
//             MSGCLASS=Y,MSGLEVEL=(1,1),             
//             NOTIFY=&SYSUID                         
//STEP010  EXEC PGM=IEBCOPY,REGION=1024K               
//SYSPRINT DD SYSOUT=*                                 
//I1       DD DSN=YOUR INPUT PDS,                   
//            DISP=SHR                                 
//O1       DD DSN=P.*.*.APR2003,                 
//            DISP=(NEW,CATLG,DELETE),                 
//            UNIT=SYSDA,                             
//            SPACE=(CYL,(1,2,10),RLSE),               
//            DCB=(LRECL=080,RECFM=FB,BLKSIZE=0)       
//SYSIN    DD *                                       
COPY1 C O=O1,I=((I1,R))                               
//*                   



This will copy the entire pds to p.*.*.APR2003 PDS

If you want only select members then you can select them also.In that case add the following statements after the line
Code:

C'COPY1 C O=O1,I=((I1,R))',/,   


Code:

C'SELC1 S M=MEMBER1,MEMBER2,...',/,



Hope this helps...

cheers

kolusu

PS: Frank will be able to let you another way of doing this using the new features which are introduced in via PTF
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Wed Apr 09, 2003 11:01 am    Post subject: Reply with quote

Kolusu said:

Quote:

Frank will be able to let you another way of doing this using the new features which are introduced in via PTF


Right. DFSORT R14 PTF UQ99331 (March, 2002) let's you use DATEn constants for INREC, OUTREC and OUTFIL OUTREC that can simplify this job to one COPY operation instead of two COPY operations like so:

Code:

//STEP0200 EXEC PGM=ICETOOL
//TOOLMSG   DD SYSOUT=*
//DFSMSG    DD SYSOUT=*
//REC       DD *
RECORD
/*
//OUT       DD SYSOUT=(*,INTRDR)
//TOOLIN    DD *
  COPY FROM(REC) USING(CTL1)
/*
//CTL1CNTL  DD *
  INREC FIELDS=(DATE2)   CREATE DATE AS C'YYYYMM'
  OUTREC FIELDS=(5,2,CHANGE=(3,C'01',C'JAN',
                             C'02',C'FEB',
                             C'03',C'MAR',
                             C'04',C'APR',
                             C'05',C'MAY',
                             C'06',C'JUN',
                             C'07',C'JUL',
                             C'08',C'AUG',
                             C'09',C'SEP',
                             C'10',C'OCT',
                             C'11',C'NOV',
                             C'12',C'DEC'),
                             NOMATCH=(1,2),1,4)
  OUTFIL FNAMES=OUT,
   OUTREC=(C'//TID-NO-Z JOB ',X'7D',C'CREATE DSN',X'7D',C',CLASS=A,',/,
         C'//',13X,C'MSGCLASS=Y,MSGLEVEL=(1,1),',/,
         C'//',13X,C'NOTIFY=&SYSUID',/,
         C'//STEP010  EXEC PGM=IEBCOPY,REGION=1024K',/,
         C'//SYSPRINT DD SYSOUT=*',/,
         C'//I1       DD DSN=YOUR INPUT PDS,',/,
         C'//            DISP=SHR',/,
         C'//O1       DD DSN=P.*.*.',1,7,C',',/,
         C'//            DISP=(NEW,CATLG,DELETE),',/,
         C'//            UNIT=SYSDA,',/,
         C'//            SPACE=(CYL,(20,20,60),RLSE),',/,
         C'//            DCB=(LRECL=ZZZ,RECFM=FB,BLKSIZE=0)',/,
         C'//SYSIN    DD *',/,
         C'COPY1 C O=O1,I=((I1,R))',/,
         C'//*',80:X)
/*


For more information on DFSORT's DATEn constants, see see the "How can I put timestamps in my output records?" Ask Professor Sort item at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/professor_sort/
_________________
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


Last edited by Frank Yaeger on Fri Aug 25, 2006 5:52 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
theenigma
Beginner


Joined: 09 Jan 2003
Posts: 15
Topics: 6

PostPosted: Thu Apr 10, 2003 6:32 am    Post subject: Reply with quote

kolusu / Frank ,
Ur solution works, but i have a few things to say - this job has to run in Production, the datasets that are created are Production datasets. The scheduling tool we use is CA7. Iam not sure if the second job that is created out of this and submitted, will be recognized or allowed to run by CA7.
Remember, Production Datasets can be created only when run through ca7. and i dont think that will happen with the soln u have suggested.

ur say?

the Enigma
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Apr 10, 2003 6:51 am    Post subject: Reply with quote

Enigma,

The second job will run and it will not have any record in CA-7. As long as you are permitted to submit the job to the INTRDR you will be able to create the dataset. I guess you need to change the jobcard from your TID to one of your production job, as such most shops do not let TID's create production datasets in production. since it is run via CA-7 remove the notify parameter also.

Hope this helps....

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
theenigma
Beginner


Joined: 09 Jan 2003
Posts: 15
Topics: 6

PostPosted: Thu Apr 10, 2003 7:12 am    Post subject: Reply with quote

Kolusu,
The question is, will it run through the CA7 queue? It has to, to create Prod Datasets. In our place, unless a job is scheduled to run under CA7, it cant create or delete datasets.
Listen, if anybody can run one job in CA7 and have that job, trigger-run other jobs through the internal reader(Creating and deleting datasets), then what happens to security(for GOD's sake, these are critical datasets)? is it so easy to bypass CA7? i dont think so!
Anyway, i will check with my people here.

the Enigma
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Apr 10, 2003 7:31 am    Post subject: Reply with quote

Enigma,

CA-7 is just scheduling package. It has no control over your dataset creation/deletion . It is your site's RACF/ACF2 package which grants the authority to create/delete datasets.

On the side note there are many ways to bypass CA-7 since it is just a schdueling package.The tough thing would be by passing RACF/ACF2 authorizations

Hope this is clear now

Kolusu

PS: Don't get too agressive if you don't like the solution. You can tone down your voice.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
theenigma
Beginner


Joined: 09 Jan 2003
Posts: 15
Topics: 6

PostPosted: Thu Apr 10, 2003 7:55 am    Post subject: Reply with quote

Kolusu,
it is not that i didnt like ur solution, if it had been so, i would not have tried ur solution, but i have tested it in the test region.and wanted to use it in Prod.

only that, i wanted to be a 100% sure when i hand this over to the Production Control people. and if in any way, i have offended you or projected that i was of the offensive kind, do forgive! (iam not that kind of a person!).

Quote:

CA-7 is just scheduling package. It has no control over your dataset creation/deletion


i didnt say that, all i said was the second job might not run under the CA7 queue and might not enjoy the same privilages as the first job (or thats what i thought, that CA7 determines what authority to be given to the job and RACF will check the authorizations and grant access) .Please help me out with this RACF and stuff, a link maybe so that i can understand better.

iam new to all this, infact just 6 months old to the world of mainframes, and iam trying to put bits and pieces together, trying to get the full picture, my knowledge therefore is very much what i percieve from what i see and what i hear from others.

hope my time in the forum helps me learn things!

Kolusu, i apologize!

the Enigma
Back to top
View user's profile Send private message
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Fri Apr 11, 2003 11:19 am    Post subject: Reply with quote

Hi,

I've always thought that using the system date in these situations is risky.

As an example, what do you do if running the job is delayed into the next month?

I prefer coding the date as a symbolic in the JCL and have production control enter the value each time the job is run.
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