IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Data and time variable in JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ozgurseyrek

New User


Joined: 22 Feb 2008
Posts: 70
Location: Turkey

PostPosted: Thu Jul 15, 2010 12:00 pm
Reply with quote

Hi,
I want to use system date and System time as a variable, just like that sample. I think that is very simple and major usage for other operating systems and programing languages, but I couldn't find anything for that at mainframe and JCL.

Code:
//PGM1     EXEC  PGM=MYPGM     
//SYSOUT   DD    SYSOUT=*     
//SYSPRINT DD    SYSOUT=*     
//SYSIN    DD    *             
  &&SYSDATE                   
  &&SYSTIME                   
/*                             
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jul 15, 2010 12:11 pm
Reply with quote

Your best bet would be to either use the scheduler variables available at your site or perhaps to write a small REXX to extract date and time and put them into a dataset for use by subsequent programs.
Back to top
View user's profile Send private message
ozgurseyrek

New User


Joined: 22 Feb 2008
Posts: 70
Location: Turkey

PostPosted: Thu Jul 15, 2010 12:20 pm
Reply with quote

I can't use scheduler variables for that purpose because I will use that variabe several times in a JCL. Scheduler will put the same values for all variables...

I used SORT step for that just below. but it means extra steps..

Code:
//SORTST1  EXEC  PGM=SORT                         
//SYSOUT   DD    SYSOUT=*                         
//SYSPRINT DD    SYSOUT=*                         
//SORTIN   DD    *                                 
STRT TIME :                                       
//SORTOUT  DD    DSN=TEST.FILE1.XXX,               
//             DISP=(,CATLG,DELETE),               
//             SPACE=(CYL,(1,1)),RECFM=FB,LRECL=80
//SYSIN    DD    *                                 
  SORT FIELDS=(COPY)                               
  OUTREC FIELDS=(1,13,DATE1,X,TIME1,42X)           
/*                                                 


thanks...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts To get the the current time DFSORT/ICETOOL 13
Search our Forums:

Back to Top