| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| Ambreen Beginner
 
 
 Joined: 25 Feb 2020
 Posts: 1
 Topics: 1
 Location: Chennai
 
 | 
			
				|  Posted: Wed Feb 26, 2020 4:31 am    Post subject: ftp file rename dynamically |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| Nic Clouston Advanced
 
 
 Joined: 01 Feb 2007
 Posts: 1075
 Topics: 7
 Location: At Home
 
 | 
			
				|  Posted: Wed Feb 26, 2020 8:37 am    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Wed Feb 26, 2020 12:02 pm    Post subject: |   |  
				| 
 |  
				| 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
 www.linkedin.com/in/kolusu
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |