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: 4650
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: 8132
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: 8132
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 Match two files using multiple keys a... santoshks1987 SYNCSORT 10 Fri Aug 18, 2017 10:50 am
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm


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