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: 187
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
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts DSNACCOX (can it be run on 1 db/ts, t... SRICOBSAS DB2 3 Sat May 06, 2017 12:59 am
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm


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