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

Is there is a way to append Date and Time in FTP file


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ssowmya

New User


Joined: 10 Oct 2006
Posts: 40

PostPosted: Thu Feb 22, 2007 4:03 pm
Reply with quote

Could anyone please let me know if there is a way to append Date and Time in FTP file....

Code:

//STEPFTP  EXEC PGM=FTP
//SYSTCPD  DD DISP=SHR,DSN=SYS0.PARMLIB(TCPDATA)                 
//OUTPUT   DD SYSOUT=*                                           
//SYSPRINT DD SYSOUT=*                                           
//INPUT    DD *                 
 IP Address                                 
 User ID                                                       
 Pass Word                                                       
 File Path
 PUT 'Host File' FTPTEST_Date_Time.TXT                       
 QUIT                                           
/*                 
//*
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Feb 22, 2007 5:33 pm
Reply with quote

I'm not sure I follow your question - you've already shown how in your example. All you need is for your application/program/utility/script to supply the appropriate values to the target filename string, FTPTEST_Date_Time.TXT, in the appropriate format, i.e. the application creates the string FTPTEST_20070222_0800.TXT in the dataset 'HLQ.FTPPUT'. The FTP job picks that up:

Code:

//STEPFTP  EXEC PGM=FTP
//SYSTCPD  DD DISP=SHR,DSN=SYS0.PARMLIB(TCPDATA)                 
//OUTPUT   DD SYSOUT=*                                           
//SYSPRINT DD SYSOUT=*                                           
//INPUT    DD *                 
IP Address                                 
User ID                                                       
Pass Word                                                       
File Path
put 'Host File' +
// DD DISP=SHR,DSN=HLQ.FTPPUT
// DD *
quit                                           
/*                 
//*
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Feb 22, 2007 6:43 pm
Reply with quote

Here's an actual job I just put into production yesterday. It only needs the date, but the method for the time is similar:

Code:

//jobname JOB (...),CLASS=...         
//*                                                               
//STEP1    EXEC PGM=EZACFSM1                                       
//SYSIN    DD   *
put //dd:sysut1 filename_&YR4&MON&DAY..dat     
qui                                                             
/*
//SYSOUT   DD   DSN=&&T,DISP=(,PASS),UNIT=VIO,                     
//         RECFM=FB,LRECL=80,BLKSIZE=0                             
//*                                                               
//STEP2    EXEC PGM=FTP,                                           
// PARM='ftpsite 21 (Exit=8'             
//NETRC    DD   DISP=SHR,DSN=NETRC.DATASET
//SYSUT1   DD   DISP=SHR,DSN=THE.DATA.FILE
//OUTPUT   DD   SYSOUT=*                                           
//INPUT    DD   *
ascii                                               
sendsite                                           
locsite sbsendeol=crlf                             
cd /app/dashboard/loader/landing/                   
/*
//         DD   DSN=&&T,DISP=(OLD,DELETE)                         
//*                                                                 
// IF (STEP2.RC = 0) THEN                                             
//STEP3    EXEC PGM=SORT                                             
//SORTIN   DD   DISP=SHR,DSN=THE.DATA.FILE
//SORTOUT  DD   DISP=SHR,DSN=THE.DATA.FILE
//SYSOUT   DD   SYSOUT=*                                             
//SYSIN    DD   *
  OPTION COPY       
  OMIT COND=ALL     
/*
// ENDIF                                                             
//*                                                                   


The EZACFSM1 program is part of TCP/IP. It is known as the "symbol translator utility". EZACFSM1 reads an input file and writes to an output file, translating any symbols in the process.

See reference here: publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/F1A1B350/1.2.9.1?SHELF=AP0ABK19&DT=20050708113621

The symbols it translates are the MVS built-in dynamic system symbols. A basic set is provided by IBM, and others can be created by your MVS systems programmers. You can check here for the list of standard dynamic system variables: publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA1E241/2.2.2

The FTP program is part of TCP/IP. See reference here: publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/F1A1B950/3.0?DT=20050708142126
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Thu Feb 22, 2007 7:39 pm
Reply with quote

Superk,

What should we need to change is we are transfering that file to J:\asp\cai\ftp ... Please adivse on the same....

Is EZACFSM1 a utility ? is it only used for FTP operations ???
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Feb 22, 2007 8:50 pm
Reply with quote

khamarutheen wrote:

What should we need to change is we are transfering that file to J:\asp\cai\ftp

I don't know what you're asking. If you need to change directories, then you need to code an appropriate FTP "cd" (Change Directory) command.

khamarutheen wrote:
Is EZACFSM1 a utility ? is it only used for FTP operations ???


Did you look at the links I provided? EZACFSM1 is a utility, although unlike a utility such as IEBGENER or IEBCOPY, it probably does NOT reside in SYS1.LINKLIB, but instead is most likely in one of the TCP/IP Linklib's. So, I can't make any guarantee that you'll have access to it. It can be used for any purpose you desire, although I feel that you're always better off using your site's approved standardized variables, such as those provided by your job scheduling system.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Thu Feb 22, 2007 10:23 pm
Reply with quote

Quote:
What should we need to change is we are transfering that file to J:\asp\cai\ftp

I don't know what you're asking. If you need to change directories, then you need to code an appropriate FTP "cd" (Change Directory) command.


Superk , what 's my doubt is ... When we download i want to download to J: drive which is a remote system share drive ... so how do i get connected to that drive first ... moving to the directory is known but how can i move to the drive ???? icon_cry.gif
Back to top
View user's profile Send private message
ssowmya

New User


Joined: 10 Oct 2006
Posts: 40

PostPosted: Fri Feb 23, 2007 1:46 pm
Reply with quote

You have to provide the IP address of the target location in the PARM in STEP2.

Please correct me if I am wrong....
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Sun Feb 25, 2007 5:00 pm
Reply with quote

k.a.khamaurutheen, to answer your question ... I don't know. I've never seen an FTP server that allowed the user to change from the default drive designation to another drive. You might have to dig into the technical details of your software more.

To be honest, when talking about sending data to a specific drive, it almost sounds as if you want to issue a mount (using something like NFS), which is a discussion probably better suited to a Network engineer.
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top