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

How to append Previous date into a Sending Node file in JCL


IBM Mainframe Forums -> JCL & VSAM
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: Fri Jun 04, 2021 6:36 pm
Reply with quote

Hi,

I have a connect direct job to be sent from PNODE to SNODE.
Pnode is a normal Mainframe GDG file.
Snode file has to be something in this format
/path1/path2/filename_DDMMYYYY.txt
where ddmmyyyy is previous days date.
I'm able to get current date using below code but struggling to append previous date at the end. &date1-1 doesnt seem to be working.

method used:
Symbol &Rdsn = path1/path2/
Symbol &dd = &date1
Symbol &ext = . txt
snode dsn = "&Rdsn.&dd.&ext"

Your inputs would be much appreciated!!
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Sat Jun 05, 2021 1:36 pm
Reply with quote

1) Where exactly in either JCL or VSAM have you found any word about “&date1-1” ???

2) what the term “method used” stands for?

3) please give the EXACT CODE SAMPLE you have used; do not forget to enclose your code into the code tags
Back to top
View user's profile Send private message
GautamSid

New User


Joined: 04 Jun 2021
Posts: 7
Location: India

PostPosted: Sun Jun 06, 2021 2:46 pm
Reply with quote

With the below JCL I'm able to get the filename as
/PATH1/PATH2/FILENAME_CURRENTDATE.TXT

But I need it as
/PATH1/PATH2/FILENAME_YESTERDAYDATE.TXT

&DATE1-(-1) --> Usually we use this in SORT to get the yesterdaysdate, but that doesn't work here.

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
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top