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.

Topic author
Sulabh Sinha
Registered Member
Posts: 17
Joined: Tue Aug 20, 2013 10:44 am

FTP dataset with date and time appended.

Postby Sulabh Sinha » Wed Jul 20, 2016 4:50 pm

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?



Tags:


enrico-sorichetti
Global Moderator
Global Moderator
Posts: 791
Joined: Wed Sep 11, 2013 3:57 pm
Been thanked: 56 times

Re: FTP dataset with date and time appended.

Postby enrico-sorichetti » Wed Jul 20, 2016 6:04 pm

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-)

Online
User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1185
Joined: Fri Jun 28, 2013 1:22 am
Location: East Dubuque Illinois
Has thanked: 2 times
Been thanked: 73 times

Re: FTP dataset with date and time appended.

Postby Robert Sample » Wed Jul 20, 2016 6:15 pm

 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.




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

Who is online

Users browsing this forum: CommonCrawl [Bot] and 69 guests