FTP dataset with date and time appended.

Other Mainframe related questions which attracts you and there is no suitable Forum you find for it and related FAQs.
Post Reply
Sulabh Sinha
Registered Member
Posts: 17
Joined: Tue Aug 20, 2013 10:44 am

FTP dataset with date and time appended.

Post by Sulabh Sinha »

Hello All,

I have been trying to ftp a file from mainframe to windows. I need to target file name unique each time. I thought append the date and time to the file name, so that the file name generated each time is unique. To do this, have used the below JCL :

Code: Select all

//FTP001 EXEC PGM=FTP
//SYSPRINT DD SYSOUT=*
//INPUT DD *
ip address
user id
password
put 'Source_file' Target.file.YYMMDD.HHMMSS
quit. /*
//OUTPUT DD SYSOUT=*
 But it does not work. Can someone help me on this?
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

Re: FTP dataset with date and time appended.

Post by enrico-sorichetti »

But it does not work. Can someone help me on this?
NOT with the info provided!

But it does not work is just a useless generic rant
tell us what REALLY happened and what You were expecting,
after that we will think about helping You.
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1891
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: FTP dataset with date and time appended.

Post by Robert Sample »

 But it does not work.
This is a TOTALLY useless statement to make.  Among other things, you could mean (and could have said to clarify for us):
- your FTP job is failing with JCL error before executing
- your FTP job is executing but one of the FTP sub-commands is failing
- your FTP job is executing but giving an error
- your FTP job is executing but the input data set has a problem
- your FTP job is executing but the output data set is not recognizable
- your FTP job is executing but the output data set has unrecognizable data
etc
etc
etc
As a wild guess, I would say that probably you have discovered that FTP does not substitute YYMMDD  and HHMMSS with the date and time.  And this is normal because FTP does not have any variables for date or time.  The usual way to resolve this is to build the FTP sub-commands in the language of your choice (PERL and Unix shell script are both common, but even COBOL can be used) in one job step, then the next job step executes FTP with the input being the data set you just created.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Other Mainframe Topics, Off-Topics, FAQs.”