Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Allocate dataset with date and time

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
jerryte

Active User


Joined: 29 Oct 2010
Posts: 183
Location: Toronto, ON, Canada

PostPosted: Thu Aug 06, 2015 9:48 pm    Post subject: Allocate dataset with date and time
Reply with quote

Below is sample JCL using SORT and IDCAMS to allocate a dataset with the date and time as last qualifiers of the name (example 'MY.PDS.D151231.T235959').
Code:
//*
//* GENERATE IDCAMS STATEMENT TO ALLOCATE A DATASET
//* WITH DATE 'DYYMMDD' AND TIME 'THHMMSS' IN THE NAME.
//* - SPECIFY DATASET PREFIX ON PARM
//* - SPECIFY DATASET ATTRIBUTE UNDER DD=SORTIN
//*
//SORT     EXEC PGM=SORT,PARM='JP0"MY.PDS"'
//SYSOUT    DD SYSOUT=*
//SYMNOUT   DD SYSOUT=*
//SORTIN    DD *
   NEW CATALOG TRACKS SPACE(10,10) +
   DSNTYPE(LIBRARY) DSORG(PO) RECFM(F B) LRECL(80) DIR(1)
//SORTOUT   DD DSN=&&IDCAMS,
//  DISP=(NEW,PASS),SPACE=(TRK,(1,1)),
//  DSORG=PS,RECFM=FB,LRECL=80
//SYSIN     DD *
 OPTION COPY
 OUTFIL FNAMES=SORTOUT,REMOVECC,
   HEADER1=(C' ALLOCATE DSN(''',JP0,
            C'.D',DATENS=(YMD),C'.T',TIMENS=(24),
            C''') +')
//*
//* EXECUTE
//*
//IDCAMS  EXEC PGM=IDCAMS,COND=(0,NE)
//SYSPRINT DD SYSOUT=*
//SYSIN    DD DSN=&&IDCAMS,DISP=(OLD,DELETE)

REXX is better method but the above works too. Comments or suggestions are welcome.
Back to top
View user's profile Send private message

View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
No new posts CICS transaction slow response time vasanthz All Other Mainframe Topics 2 Thu Jan 19, 2017 1:31 am
No new posts DD DUMMY & CPU TIME Nileshkul Testing & Performance analysis 16 Mon Dec 19, 2016 11:35 pm
This topic is locked: you cannot edit posts or make replies. Get a job submitted itself every time... arunsoods JCL & VSAM 3 Tue Nov 22, 2016 4:05 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us