View previous topic :: View next topic
Author
Message
meetsrk New User Joined: 13 Jun 2004Posts: 85
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
amitava Warnings : 1 Active User Joined: 30 Oct 2005Posts: 186 Location: India
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
superk Global Moderator Joined: 26 Apr 2004Posts: 4652 Location: Raleigh, NC, USA
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
brgr88 New User Joined: 05 Mar 2006Posts: 6
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
Please enable JavaScript!