MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ftp file rename dynamically

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
Ambreen
Beginner


Joined: 25 Feb 2020
Posts: 1
Topics: 1
Location: Chennai

PostPosted: Wed Feb 26, 2020 4:31 am    Post subject: ftp file rename dynamically Reply with quote

I have to ftp a mainframe file to a txt file using the ftpjob where the file to be ftp'd should have a naming convention of currentdate.txt. I have retreived the current date in jcl and i have copied into an output file. Could any one help me how will i take the date value from the file and name the file.
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed Feb 26, 2020 8:37 am    Post subject: Reply with quote

Are your FTP control statements in-line in your FTP job or a PDS member? If in-line then you should be able to simply use system symbols in your JCL otherwise you cannot do it with JCL but will have to find some other way eg. using your sort product or writing small program in the language of your choice. JCL does not manipulate data - it simply telss the OS what programs you want to run and the resources required.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Wed Feb 26, 2020 12:02 pm    Post subject: Reply with quote

Ambreen,

You can use EZACFSM1 to substitute the current date into your FTP control cards. Run this step before your FTP step. Here is an explanation of dynamic system symbols

https://www.ibm.com/support/knowledgecenter/SSLTBW_2.3.0/com.ibm.zos.v2r3.ieae200/dynpsm.htm

Code:

//STEP0100 EXEC PGM=EZACFSM1       
//SYSOUT   DD SYSOUT=*             
//SYSIN    DD DATA,DLM=@@           
XXXX\XXXXFTP                       
XXXX                               
CD YYYY YYYYY                       
SENDSITE                           
PUT //DD:IN0001 +                   
   FILEON-&LYR4.-&LMON.-&LDAY..TXT 
QUIT                               
@@                                 


The output of this is :
Code:

XXXX\XXXXFTP               
XXXX                       
CD YYYY YYYYY               
SENDSITE                   
PUT //DD:IN0001 +           
   FILEON-2020-02-26.TXT   
QUIT                       

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group