View previous topic :: View next topic
Author
Message
gakandalkar New User Joined: 20 Feb 2007Posts: 9 Location: pune
Hi,
I want to know, How to ftp GDG version from mainframe to UNIX server with DATE STAMP.
Back to top
superk Global Moderator Joined: 26 Apr 2004Posts: 4652 Location: Raleigh, NC, USA
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
gakandalkar New User Joined: 20 Feb 2007Posts: 9 Location: pune
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
sandeep1dimri New User Joined: 30 Oct 2006Posts: 76
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
expat Global Moderator Joined: 14 Mar 2007Posts: 8797 Location: Welsh Wales
Errrrmmmmmm,
I think that the
Quote:
"unix.filename.as.required"
means that you can put what you want in that field.
Back to top
gakandalkar New User Joined: 20 Feb 2007Posts: 9 Location: pune
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
gakandalkar New User Joined: 20 Feb 2007Posts: 9 Location: pune
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
Please enable JavaScript!