Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

how to FTP file with DATE stamp

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
gakandalkar

New User


Joined: 20 Feb 2007
Posts: 9
Location: pune

PostPosted: Tue Mar 27, 2007 10:35 am    Post subject: how to FTP file with DATE stamp
Reply with quote

Hi,

I want to know, How to ftp GDG version from mainframe to UNIX server with DATE STAMP.
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue Mar 27, 2007 6:04 pm    Post subject: Re: how to FTP file with DATE stamp
Reply with quote

Code:

//FTP EXEC PGM=FTP,PARM='.....'
//NETRC DD DSN=NETRC,DISP=SHR
//SENDFILE DD DSN=THE.GDG.TO.SEND(0),DISP=....
//INPUT DD DSN=.....,DISP=...
//OUTPUT DD SYSOUT=*


where the input dataset looks like:

Code:

sendsite
ascii
put //dd:sendfile unix.filename.as.required...
qui
Back to top
View user's profile Send private message
gakandalkar

New User


Joined: 20 Feb 2007
Posts: 9
Location: pune

PostPosted: Wed Mar 28, 2007 10:24 am    Post subject: Re: how to FTP file with DATE stamp
Reply with quote

Thanks for replay..

But the i want UNIX file name with date stamp.
i.e. if i am uploading file on 23Th mar 2007 , I want UNIX file name with date stamp e.g.(23mar2007), instead of "unix.filename.as.required".

So is there any parameter which returns system current date , and that can i use as destination file name.
Back to top
View user's profile Send private message
sandeep1dimri

New User


Joined: 30 Oct 2006
Posts: 76

PostPosted: Wed Mar 28, 2007 12:23 pm    Post subject:
Reply with quote

Hi

You can code one program that will create a crate the control card for the FTP execution and with this card FTP will run
for example

//FTP EXEC PGM=FTP,PARM='.....'
//NETRC DD DSN=NETRC,DISP=SHR
//SENDFILE DD DSN=THE.GDG.TO.SEND(0),DISP=....
//INPUT DD DSN=.....,DISP=...
//OUTPUT DD SYSOUT=*



where the input dataset looks like:

Code:

sendsite
ascii
put //dd:sendfile unix.filename.as.required...
quiT

so ur program will generate the above input file as

sendsite
ascii
put //dd:sendfile unix.filename.with.date...
quiT
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Mar 28, 2007 12:24 pm    Post subject:
Reply with quote

Errrrmmmmmm,

I think that the
Quote:
"unix.filename.as.required"
means that you can put what you want in that field.
Back to top
View user's profile Send private message
gakandalkar

New User


Joined: 20 Feb 2007
Posts: 9
Location: pune

PostPosted: Thu Mar 29, 2007 10:14 am    Post subject: Solution
Reply with quote

icon_biggrin.gif Thanks to All for replay......Special thanks to Sandeep

I follow approach given by sandeep D , and following is the solution for same.

and now i am dynamically generating target file name(which contains date)

I wrote a REXX prog to generate control card for FTP as follows,


Call Create_date_FTP
/*
/*
zispfrc = Ret_Code
"ISPEXEC VPUT ZISPFRC SHARED"
Return

Create_date_FTP: Procedure Expose Ret_Code

FTP_Server = "IP address"
Ret_Code = 0

FTP_UserName = "username"
FTP_Password = "password"
FTP_CMD = "PUT"
FTP_FOLDER = "source dataset"
TEMP = Date()
Parse Var TEMP DD" "MM" "YYYY
YY=Strip(Substr(YYYY,3,4))
filename = "'unix/file"||MM||DD||YY||"'"

OutLines.1 = FTP_Server||" (exit=99"
OutLines.2 = FTP_UserName||" "||FTP_Password
OutLines.3 = FTP_CMD||" "||FTP_FOLDER||" "||filename

OutLines.4 = "quit"
OutLines.0 = 4
Do i = 1 to OutLines.0
Push OutLines.i
"EXECIO 1 DISKW UT12"
End
"EXECIO 0 DISKW UT12 (FINIS"
Return



And i used , created control card for input to the FTP command

the jcl for same is as follows


//job card
//*------------------------------------------------------------------
//STEP0001 EXEC PGM=IEFBR14
//DD01 DD DSN=ftp control card file,
// DISP=(MOD,DELETE,DELETE)
//DD02 DD DSN=report file,
// DISP=(MOD,DELETE,DELETE)
//*------------------------------------------------------------------
//STEP0002 EXEC PGM=IKJEFT01,DYNAMNBR=30,REGION=4096K
//SYSEXEC DD DSN=REXXLIB,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DSN=REXX prog,
// DISP=SHR
//SYSOUT DD SYSOUT=*
//UT12 DD DSN=ftp control card file,
// DISP=(NEW,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),
// SPACE=(CYL,(1,1),RLSE)
//SYSPROC DD DUMMY
//ISPPLIB DD DSN=SISPPENU,DISP=SHR
//ISPMLIB DD DSN=SISPMENU,DISP=SHR
// DD DSN=SISPMENU,DISP=SHR
//ISPSLIB DD DSN=SISPSLIB,DISP=SHR
//ISPPROF DD DSN=ISPPROF,
// DISP=SHR
//ISPTLIB DD DISP=(NEW,DELETE,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1,1,1)),
// DCB=SISPTENU
// DD DSN=SISPTENU,
// DISP=SHR
// DD DSN=SISPTENU,
// DISP=SHR
//ISPWRK1 DD DISP=NEW,UNIT=VIO,SPACE=(CYL,(1,1)),
// DCB=(LRECL=256,BLKSIZE=2560,RECFM=FB)
//ISPWRK2 DD DISP=NEW,UNIT=VIO,SPACE=(CYL,(1,1)),
// DCB=(LRECL=256,BLKSIZE=2560,RECFM=FB)
//ISPCTL1 DD DISP=NEW,UNIT=VIO,SPACE=(CYL,(1,1)),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB)
//ISPCTL2 DD DISP=NEW,UNIT=VIO,SPACE=(CYL,(1,1)),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB)
//ISPLST1 DD DISP=NEW,UNIT=VIO,SPACE=(CYL,(1,1)),
// DCB=(LRECL=121,BLKSIZE=1210,RECFM=FBA)
//ISPLST2 DD DISP=NEW,UNIT=VIO,SPACE=(CYL,(1,1)),
// DCB=(LRECL=121,BLKSIZE=1210,RECFM=FBA)
//ISPLOG DD SYSOUT=*,
// DCB=(DSORG=PS,RECFM=VA,LRECL=125,BLKSIZE=129)
//**************************************************
//STEP0003 EXEC PGM=FTP
//SYSFTPD DD DISP=SHR,DSN=(FTP)
//SYSTCPD DD DISP=SHR,DSN=(TCPIP)
//SYSMDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//OUTPUT DD DSN=report file,DISP=(NEW,CATLG,CATLG),
// DCB=(DSORG=PS,RECFM=FB,LRECL=80),
// UNIT=DISK,SPACE=(CYL,(1,1))
//INPUT DD DSN=ftp control card file,DISP=SHR
Back to top
View user's profile Send private message
gakandalkar

New User


Joined: 20 Feb 2007
Posts: 9
Location: pune

PostPosted: Thu Mar 29, 2007 10:19 am    Post subject:
Reply with quote

Sorry i forgot to mention REXX prog output.

the FTP control card will look like follows


**************************************
IP address
username password
PUT 'source dataset' 'destination folder/subfol/mar2807'
QUIT
**************************** Bottom of Data ********
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us