|
View previous topic :: View next topic
|
| Author |
Message |
pradyutonnet Currently Banned New User
Joined: 13 Nov 2005 Posts: 29 Location: pune,mumbai
|
|
|
|
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 |
|
 |
superk
Global Moderator

Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
 |
pradyutonnet Currently Banned New User
Joined: 13 Nov 2005 Posts: 29 Location: pune,mumbai
|
|
|
|
| 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 |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8798 Location: Welsh Wales
|
|
|
|
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 |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
| FTP allows you to use the DIR command. |
|
| Back to top |
|
 |
pradyutonnet Currently Banned New User
Joined: 13 Nov 2005 Posts: 29 Location: pune,mumbai
|
|
|
|
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 |
|
 |
raj12vel
New User
Joined: 20 Dec 2008 Posts: 43 Location: New Jersey
|
|
|
|
Hi,
Can you please explain me the above concept?
Thanks in Advance
Raj. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
It is not clear what you are asking. . . What would you like explained? |
|
| Back to top |
|
 |
raj12vel
New User
Joined: 20 Dec 2008 Posts: 43 Location: New Jersey
|
|
|
|
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 |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
| EZACFSM1 is used to substitute symbols -- the &DAY, &MON, &YR4 symbols in the file name are replaced by their values. |
|
| Back to top |
|
 |
|
|