One way, presuming the job runs once per day:
//SFTPB24E JOB (7330),MSGCLASS=X,CLASS=P,NOTIFY=&SYSUID,USER=STCSYS
//GETYEST EXEC PGM=IKJEFT01,REGION=0M
//SYSEXEC DD DISP=SHR,DSN=SYS1.SBPXEXEC
//OUTPUT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DISP=OLD,DSN=MYHLQ.YESTFILE.CMD
//*/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*
//BLDGET IF RC=0 THEN
//BYEBYE EXEC PGM=IEFBR14
//YESTFILE DD DISP=(MOD,DELETE),DSN=MYHKQ.YESTFILE.CMD,
// UNIT=SYSALLDA,SPACE=(TRK,(0))
//*----------------------------------------------------------------*
//STEP0 EXEC PGM=EZACFSM1
//SYSOUT DD DSN=MYHLQ.YESTFILE.CMD,DISP=(NEW,CATLG),
// SPACE=(TRK,(1,0)),UNIT=SYSALLDA
//SYSIN DD DATA,DLM=@@
OSHELL { echo 'lcd /u/op117/'; +
echo 'cd /XX/Output/TMP'; +
echo 'ASCII'; +
echo 'get MDS_&LYR4.&LMON.&LDAY..txt'; } | +
sftp -P 2222 [email protected]
oget '/u/op117/MDS_&LYR4.&LMON.&LDAY..txt' -
'MCCP.DATA.XX.MDS.SFTP'
@@
//BLDGET ENDIF
Seed it by running the BLDGET steps the day before regular runs begin.
Michael
At 01:58 AM 6/23/2022, saurabh khandelwal wrote:
Dear Team,
Thanks for reply and helping me to resolve this issue.
1) Mainframe is getting file from windows. So, few of the files in
windows having todays date and few of them having yesterdayâs date( today
-1) .
2) For todays date below code is the solution you all suggested and
worked out.
//SFTPB24E JOB (7330),MSGCLASS=X,CLASS=P,NOTIFY=&SYSUID,USER=STCSYS
//STEP0 EXEC PGM=EZACFSM1
//SYSOUT DD DSN=&&T,DISP=(,PASS),SPACE=(TRK,(1,0)),UNIT=VIO
//SYSIN DD DATA,DLM=@@
OSHELL { echo 'lcd /u/op117/'; +
echo 'cd /XX/Output/TMP'; +
echo 'ASCII'; +
echo 'get MDS_&LYR4.&LMON.&LDAY..txt'; } | +
sftp -P 2222 [email protected]
oget '/u/op117/MDS_&LYR4.&LMON.&LDAY..txt' -
'MCCP.DATA.XX.MDS.SFTP'
@@
//STEP1 EXEC PGM=IKJEFT01,REGION=0M
//SYSEXEC DD DISP=SHR,DSN=SYS1.SBPXEXEC
//OUTPUT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DISP=(OLD,PASS),DSN=&&T
3) Now, to get the file into Mainframe using SFTP and oshell with
yesterdays date is the step we failing. So, can you please help me to
change this code mentioned above to get yesterdays file.
Thank you so much once again for help.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN