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 unknow file from FTP location.

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

New User


Joined: 13 Nov 2005
Posts: 29
Location: pune,mumbai

PostPosted: Thu Sep 03, 2009 1:24 pm    Post subject: How To FTP unknow file from FTP location.
Reply with quote

i want to FTP one file from FTP server, but the probelm is that every time the FTP input file name is change on FTP server, i have coded one FTP job as below and its went sucessfully ...here in this job i have hardcoded the input file name.
Code:

//FTP1     EXEC PGM=FTP
//OUTPUT   DD SYSOUT=*
//SYSPRNT  DD SYSOUT=*
//INPUT    DD *
10.2.78.20   (EXIT
flame
p4ssw0rd
GET  /home/imrtstcp/LPC/Outbox/MTBC_Pickup_02-09-2009.txt +
     'FSP.KY2K.KLY620.MTBC.FEED' (REPLACE
QUIT
//*


my probelm is that i dont know how to handle diff file name in job like

in above job file name is :-MTBC_Pickup_02-09-2009.txt
but in next run i would be :- MTBC_Pickup_03-09-2009.txt
then :- MTBC_Pickup_03-09-2009.txt

file name is change accorrding to date as mantion above...
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: Thu Sep 03, 2009 3:28 pm    Post subject: Reply to: How To FTP unknow file from FTP location.
Reply with quote

There are only a few options here:

1. Have the remote site change the filenames to match YOUR site's dataset naming standards, and then you can use MGET all you want. This is most likely NOT going to happen.

2. First retrieve a directory listing from their server, interrogate it, and build your FTP GET command(s) as needed.

3. Honestly, if they are creating the file, then why aren't you mandating that they initiate the transfer and send to you? This is the preferred method whenever possible.
Back to top
View user's profile Send private message
pradyutonnet
Currently Banned

New User


Joined: 13 Nov 2005
Posts: 29
Location: pune,mumbai

PostPosted: Thu Sep 03, 2009 4:18 pm    Post subject:
Reply with quote

i think 2nd option would work for me ...can you explain me in detail how i can use 2nd option for resolving my issue
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: Thu Sep 03, 2009 4:40 pm    Post subject:
Reply with quote

1) FTP to remote and retrieve directory list
2) Process list from (1) and get required file name
3) Build FTP statements using correct filename
4) Execute FTP step

REXX would probably be a good tool to use as the intermediate step.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8086
Location: East Dubuque, Illinois, USA

PostPosted: Thu Sep 03, 2009 4:48 pm    Post subject:
Reply with quote

FTP allows you to use the DIR command.
Back to top
View user's profile Send private message
pradyutonnet
Currently Banned

New User


Joined: 13 Nov 2005
Posts: 29
Location: pune,mumbai

PostPosted: Thu Sep 03, 2009 5:35 pm    Post subject:
Reply with quote

i had use some diff logic for my FTP job and its working for me

Code:
//SYM    EXEC PGM=EZACFSM1                         
//SYSOUT DD   DSN=&T1,DISP=(,PASS),UNIT=VIO       
//SYSIN  DD   *                                   
10.2.78.20   (EXIT
flame
p4ssw0rd
GET  /home/imrtstcp/LPC/Outbox/MTBC_Pickup_&DAY-&MON-&YR4.txt +
     'FSP.KY2K.KLY620.MTBC.FEED' (REPLACE
QUIT     
/*       
//FTP    EXEC PGM=FTP
//INPUT DD    DSN=&T1,DISP=(OLD,PASS)



here i can easily handle my date related file name issue
Back to top
View user's profile Send private message
raj12vel

New User


Joined: 20 Dec 2008
Posts: 43
Location: New Jersey

PostPosted: Fri Sep 11, 2009 12:08 am    Post subject: Reply to: How To FTP unknow file from FTP location.
Reply with quote

Hi,

Can you please explain me the above concept?

Thanks in Advance
Raj.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Sep 11, 2009 12:51 am    Post subject:
Reply with quote

Hello,

It is not clear what you are asking. . . What would you like explained?
Back to top
View user's profile Send private message
raj12vel

New User


Joined: 20 Dec 2008
Posts: 43
Location: New Jersey

PostPosted: Tue Sep 15, 2009 7:34 pm    Post subject: Reply to: How To FTP unknow file from FTP location.
Reply with quote

Hi,

Can you explain the below code?

Code:

//SYM    EXEC PGM=EZACFSM1                         
//SYSOUT DD   DSN=&T1,DISP=(,PASS),UNIT=VIO       
//SYSIN  DD   *                                   
10.2.78.20   (EXIT
flame
p4ssw0rd
GET  /home/imrtstcp/LPC/Outbox/MTBC_Pickup_&DAY-&MON-&YR4.txt +
     'FSP.KY2K.KLY620.MTBC.FEED' (REPLACE
QUIT     
/*       
//FTP    EXEC PGM=FTP
//INPUT DD    DSN=&T1,DISP=(OLD,PASS)



What this PGM= EZACFSM1 will do?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8086
Location: East Dubuque, Illinois, USA

PostPosted: Tue Sep 15, 2009 7:45 pm    Post subject:
Reply with quote

EZACFSM1 is used to substitute symbols -- the &DAY, &MON, &YR4 symbols in the file name are replaced by their values.
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 FTP xls file from Mainfrmae kumarsatheeshc1 TSO/ISPF 5 Tue Jun 20, 2017 6:56 pm
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts XML Parse for large file muralikrishnan_new COBOL Programming 3 Mon Jun 12, 2017 12:50 pm


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