IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to FTP file with DATE stamp


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Tue Mar 27, 2007 6:04 pm
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
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
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: 8797
Location: Welsh Wales

PostPosted: Wed Mar 28, 2007 12:24 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top