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
 

 

How to Generate system date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
meetsrk

New User


Joined: 13 Jun 2004
Posts: 85

PostPosted: Mon Feb 27, 2006 6:23 pm    Post subject: How to Generate system date
Reply with quote

Hi all,

Can anyone please tell me how to generate a date and appending it to the dataset name.

For Eg.

G1XXXX.PSFILE.DS.DZZZZZ

where ZZZZZ - system date (in any format)
Back to top
View user's profile Send private message

amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Mon Feb 27, 2006 6:34 pm    Post subject:
Reply with quote

HI meetsrk,
U can do one thing. U can call a rexx routine from a JCL and in the REXX routine u can get the date function and append it in a DSs name and allocate the DS. If u want the code, i will send u back.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Mon Feb 27, 2006 6:49 pm    Post subject: Re: How to Generate system date using Jcl
Reply with quote

This is my preferred method:
Code:

//STEP0001 EXEC PGM=ICEGENER /* REXX EXAMPLE */                                 
//SYSUT1   DD   *,DLM=@@                                     
/* REXX */                                                   
RC = LISTDSI(SYSUT1 'FILE')                                 
OLD_DSN = SYSDSNAME                                         
NEW_DSN = OLD_DSN||'.D'||DATE(J)                             
"ALLOC DD(SYSUT2) DA('"NEW_DSN"') NEW REU CATALOG",         
"LIKE('"OLD_DSN"')"                                         
"CALL *(ICEGENER)"                                           
EXIT 0                                                       
@@                                                           
//SYSUT2   DD   DSN=&&X(XDATE),DISP=(,PASS),UNIT=VIO,       
//         SPACE=(TRK,(1,1,1),RLSE)                         
//SYSPRINT DD   SYSOUT=*                                     
//SYSIN    DD   DUMMY                           
//*                                                     
//STEP0002 EXEC PGM=IKJEFT01,PARM='%XDATE'               
//SYSEXEC  DD   DSN=&&X,DISP=(OLD,PASS)                 
//SYSTSPRT DD   SYSOUT=*                                 
//SYSTSIN  DD   DUMMY                                   
//SYSUT1   DD   DSN=INPUT.DATASET,DISP=SHR
//SYSPRINT DD   SYSOUT=*                                 
//SYSIN    DD   DUMMY                                   
//*         
//*                                                             
//STEP0003 EXEC PGM=ICEGENER /* CLIST EXAMPLE */                                     
//SYSUT1   DD   *,DLM=@@                                         
PROC 0                                                           
CONTROL NOMSG                                                   
LISTDSI SYSUT1 FILE                                             
SET &OLDDSN = &STR(&SYSDSNAME)                                   
SET &YY  = &SUBSTR(1:2,&SYSJDATE)                               
SET &DDD = &SUBSTR(4:6,&SYSJDATE)                               
SET &NEWDSN = &STR(&OLDDSN)&STR(.D)&STR(&YY)&STR(&DDD)           
ALLOC DD(SYSUT2) DA('&NEWDSN') NEW REU LIKE('&OLDDSN')           
CALL *(ICEGENER)                                                 
EXIT CODE(0)                                                     
@@                                                               
//SYSUT2   DD   DSN=&&C(XDATE),DISP=(,PASS),UNIT=VIO,           
//         SPACE=(TRK,(1,1,1),RLSE)                             
//SYSPRINT DD   SYSOUT=*                                         
//SYSIN    DD   DUMMY                                           
//*                                                   
//STEP0004 EXEC PGM=IKJEFT01,PARM='%XDATE'             
//SYSPROC  DD   DSN=&&C,DISP=(OLD,PASS)               
//SYSTSPRT DD   SYSOUT=*                               
//SYSTSIN  DD   DUMMY                                 
//SYSUT1   DD   DSN=INPUT.DATASET,DISP=SHR
//SYSPRINT DD   SYSOUT=*                               
//SYSIN    DD   DUMMY                                 
//*                                                         
Back to top
View user's profile Send private message
brgr88

New User


Joined: 05 Mar 2006
Posts: 6

PostPosted: Sun Mar 05, 2006 5:45 am    Post subject:
Reply with quote

meetsrk,


/* REXX */
yymmdd = RIGHT(DATE('S'),6)
dsname = 'G1XXXX.PSFILE.DS.D'yymmdd


Here, the variable "yymmdd" equals the date in yymmdd format, so:
March 4, 2006 = 060304

Your datasetname would be:
G1XXXX.PSFILE.DS.D060304

I prefer this method since the datasets will list in chronological order in ISPF 3.4.
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am


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