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

Connect:Direct Add yesterday date in TODSN filename in JCL


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
GautamSid

New User


Joined: 04 Jun 2021
Posts: 7
Location: India

PostPosted: Sun Jun 06, 2021 8:30 pm
Reply with quote

How to add yesterday date in TODSN filename in Connect Direct - JCL

Using below code able to append todays date.

Code:


PROCC1   PROCESS
         SYMBOL &RDSN=\'/PATH1/PATH2/FILENAME_'\
         SYMBOL &DD1=&DATE1
         SYMBOL &TXT=.TXT
         SYMBOL &SDSN=FILENAME.G0001V00

STEP2   COPY FROM(PNODE DSN=&SDSN DISP=SHR
             DCB=(REC=FB, LRECL=3200,BLKSIZE=3200,DSORG=PS))
             TO(SNODE DSN="&RDSN.&DD1.&TXT" DISP=RPL
             DCB=(REC=FB, LRECL=3200,BLKSIZE=3200,DSORG=PS))

Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 518
Location: Bamberg, Germany

PostPosted: Sun Jun 06, 2021 9:30 pm
Reply with quote

Have you seen anywhere in the documentation https://www.ibm.com/docs/en/SS4PJT_6.1.0/cd_zos_PDF/cd_61_zos_pdf.pdf any hints that a date calculation is possible within C:D?

If not, please use other means (SORT?) and provide the necessary input for C:D
Back to top
View user's profile Send private message
GautamSid

New User


Joined: 04 Jun 2021
Posts: 7
Location: India

PostPosted: Tue Jun 08, 2021 12:35 am
Reply with quote

I managed to write the below to a file:

Code:

****************************
//SET DT1=07062021
****************************


But when i try to substiute the date into &DD1 the connect direct step it doesn't accept the substitution:

Code:

Actual Output --> /PATH1/PATH2/FILENAME_DT1.TXT
Expected Output -->/PATH1/PATH2/FILENAME_07082021.TXT


Code:

SET DT1=07062021

SIGNON
     SUBMIT PROC = PROG1111
     CASE=YES
     &DATE=DT1
SIGNOFF

STEP1    PROCESS
         SYMBOL &RDSN=\'/PATH1/PATH2/FILENAME_'\
         SYMBOL &DATE=&DT1
         SYMBOL &TXT=.TXT
         SYMBOL &SDSN=FILENAME.G0001V00

STEP2   COPY FROM(PNODE DSN=&SDSN DISP=SHR
             DCB=(REC=FB, LRECL=3200,BLKSIZE=3200,DSORG=PS))
             TO(SNODE DSN="&RDSN.&DATE.&TXT" DISP=RPL
             DCB=(REC=FB, LRECL=3200,BLKSIZE=3200,DSORG=PS))
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1084

PostPosted: Tue Jun 08, 2021 1:26 am
Reply with quote

A complete mess between text constants, and text variables.
Please, try to manage your code garbage yourself.
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts How to append Previous date into a S... JCL & VSAM 2
No new posts FTP - connect with certificate, no pa... JCL & VSAM 1
No new posts A Rexx who changes date into a JCL? P... CLIST & REXX 9
No new posts Compare the file record count percent... DFSORT/ICETOOL 4
No new posts Date conversion using SORT SYNCSORT 4
Search our Forums:

Back to Top