View previous topic :: View next topic
|
Author |
Message |
raj12vel
New User
Joined: 20 Dec 2008 Posts: 43 Location: New Jersey
|
|
|
|
Hi All,
I have 22 files in SAS server. I want to download all the 22 files from FTP server to mainframe as a single file.
I have tried APPE and MGET comand. but not getting the actual result.
can any one help me how to append the files in mainframe from server? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
What would I do in this case?
Run the FTP the first time and do a member list (LS) command and pull that information back into a dataset. Read that datatset, and dynamically build 22 seperate GET commands, all pointing to the one single DD for my local dataset. That DD would, of course, be specified in the allocation with DISP=MOD.
Run the FTP a second time, using the 22 dynamically built GET commands. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Do these filenames conform to normal MVS dataset naming conventions? If so, I have other ideas as well. |
|
Back to top |
|
|
raj12vel
New User
Joined: 20 Dec 2008 Posts: 43 Location: New Jersey
|
|
|
|
Code: |
//FTP1 EXEC PGM=FTP,
// REGION=2M,
// PARM='/(EXIT'
//SYSPRINT DD SYSOUT=*
//SYSDEBUG DD SYSOUT=*
//OUTPUT DD SYSOUT=*
//INPUT DD *
3.182.39.29
userid
password
CD folder name in server
GET Amx_PLCC_final.txt +
'X1GPTLH.RCF.CLOSE08.CLI.ACCTS.JUL15' (replace
QUIT
/*
|
That is my code to download a single file from server.
want to know how can we download multiple files from server to the same file name in mainframe? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
22 GET's or 22 APPEND's. I don't see any other options that don't involve using something like PKZIP. Maybe someone else does? |
|
Back to top |
|
|
raj12vel
New User
Joined: 20 Dec 2008 Posts: 43 Location: New Jersey
|
|
|
|
Do u know, how to give append command for this issue? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
The APPEND FTP command is used like a PUT command -- not a GET command. AFAIK, there is no way to accomplish the requested task except the procedure Kevin outlined -- get the names, generate a sequence of GET commands, then run them through another FTP session. FTP is oriented around transfer of one (or more) files -- it wasn't designed to transfer multiple files to one file. |
|
Back to top |
|
|
raj12vel
New User
Joined: 20 Dec 2008 Posts: 43 Location: New Jersey
|
|
|
|
is that possible to use MGET command?
If so, just give me the syntax? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
You can use the MGET command, but be aware that you will not get one file on the receiving end -- you will get one file per sending file, or 22 files per the original post.
Depending upon the default settings, you may need to use PROMPT (which toggles the prompting to download each individual file). The FTP command is MGET * to retrieve all files from the current working directory on the remote server. MGET file1 file2 file3 would retrieve from the remote server file1, then file2, then file3 -- storing them as three separate files on the local machine. |
|
Back to top |
|
|
raj12vel
New User
Joined: 20 Dec 2008 Posts: 43 Location: New Jersey
|
|
|
|
Thanks for your quick reply.
Can you please give me the code with syntax for MGET? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Robert, you're right. My bad about the APPEND command.
Unfortunately, from what the OP has shown, unless those filenames are changed to conform to normal MVS dataset naming conventions, I don't see using the MGET command. |
|
Back to top |
|
|
raj12vel
New User
Joined: 20 Dec 2008 Posts: 43 Location: New Jersey
|
|
|
|
Yes, you are right.
I have used the MGET *.txt local file name.
but got the error as ' No such file or directory.'
EZA1685W Invalid local file identifier
can you tell me what is MVS naming conventions? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
This is from your example:
'X1GPTLH.RCF.CLOSE08.CLI.ACCTS.JUL15'
Multiple nodes, each seperated by a period. A node may be 1-8 alphanumeric characters, but must start with a national character (A-Z, #, or $). No blanks or underscores or other characters. |
|
Back to top |
|
|
raj12vel
New User
Joined: 20 Dec 2008 Posts: 43 Location: New Jersey
|
|
|
|
Thats what i have given as the file name rt
then why is not accepting? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
You can't provide a local file name with the MGET command -- all operands on the MGET are remote server file names.
Should you need more assistance, could you post your FTP commands as you have them (we don't need the IP address, user id, or password) in the output of the FTP job so we can see exactly what you've got? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
My job, as I originally mentioned, would look something like this:
Code: |
//STEP0001 EXEC PGM=FTP,PARM='server.address (Exit=8'
//SYSFTPD DD DISP=SHR,DSN=MY.FTP.DATA
//FILE1 DD DSN=X1GPTLH.RCF.CLOSE08.CLI.ACCTS.JUL15,
// DISP=MOD
//OUTPUT DD SYSOUT=*
//INPUT DD *
sendsite
ascii
cd ...
get Amx_PLCC_final.txt //dd:file1
get second_file.txt //dd:file1
...
get twenty_second_file.txt //dd:file1
qui
/*
//*
|
|
|
Back to top |
|
|
raj12vel
New User
Joined: 20 Dec 2008 Posts: 43 Location: New Jersey
|
|
|
|
Can you please be more specific on the aforementioned code?
1. do i have to give the ip address in the field?
Code: |
PARM='server.address (Exit=8' |
2. what are the details whould i need to give in this file?
Code: |
//SYSFTPD DD DISP=SHR,DSN=MY.FTP.DATA |
3. where should i give the user id and password? |
|
Back to top |
|
|
raj12vel
New User
Joined: 20 Dec 2008 Posts: 43 Location: New Jersey
|
|
|
|
I got it.
It works fine.
thanks alot for your timed help.
please let me know if we have alternatives for this.
I would like to thank you al |
|
Back to top |
|
|
|