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

Multiple file FTP from mainframe to desktop


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Priyanka Pyne

New User


Joined: 09 Feb 2008
Posts: 95
Location: India

PostPosted: Wed Apr 10, 2013 12:52 pm
Reply with quote

Hi,

I want to FTP multiple PS file to corresponding .txt file. Is there any thing through which i can do so.

I have thought of using mput. But not sure if this would be the correct approach.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Apr 10, 2013 1:03 pm
Reply with quote

How about giving it a little go and see what happens?

I'm not even sure if you want multiple files on your desktop, or one.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Apr 10, 2013 3:03 pm
Reply with quote

You should be searching this Forum on similar terms, as you put in your question, there are quite a good number of similar topics around here on this Forum.
Back to top
View user's profile Send private message
ezio vin

New User


Joined: 16 Aug 2012
Posts: 44
Location: india

PostPosted: Wed Apr 10, 2013 3:25 pm
Reply with quote

Using SAS mail you can get the mainframe files as notepad file
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Wed Apr 10, 2013 5:07 pm
Reply with quote

connect to MF using windows FTP.... then use Mget command to get multiple files from MF to desktop.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Apr 10, 2013 6:18 pm
Reply with quote

Quote:
Using SAS mail you can get the mainframe files as notepad file

what if the TS organization does not have SAS

Quote:
connect to MF using windows FTP.... then use Mget command to get multiple files from MF to desktop.


a plain mget/mput command will just transfer the files storing them with the same name

the TS question seems to ask on how to append a .txt extension to each one

read the manuals about the use the nmap ftp command

here is the abstract form the unix man page


Quote:
nmap [inpattern outpattern]
Set or unset the filename mapping mechanism. If no arguments are specified, the filename
mapping mechanism is unset. If arguments are specified, remote filenames are mapped during
mput commands and put commands issued without a specified remote target filename. If argu-
ments are specified, local filenames are mapped during mget commands and get commands
issued without a specified local target filename. This command is useful when connecting
to a non-UNIX remote computer with different file naming conventions or practices. The
mapping follows the pattern set by inpattern and outpattern. [Inpattern] is a template for
incoming filenames (which may have already been processed according to the ntrans and case
settings). Variable templating is accomplished by including the sequences ``$1'', ``$2'',
... ``$9'' in inpattern. Use `\' to prevent this special treatment of the `$' character.
All other characters are treated literally, and are used to determine the nmap [inpattern]
variable values. For example, given inpattern $1.$2 and the remote file name
"mydata.data", $1 would have the value "mydata", and $2 would have the value "data". The
outpattern determines the resulting mapped filename. The sequences ``$1'', ``$2'', ...
``$9'' are replaced by any value resulting from the inpattern template. The sequence
``$0'' is replaced by the original filename. Additionally, the sequence ``[seq1, seq2]''
is replaced by [seq1] if seq1 is not a null string; otherwise it is replaced by seq2. For
example, the command

nmap $1.$2.$3 [$1,$2].[$2,file]

would yield the output filename "myfile.data" for input filenames "myfile.data" and
"myfile.data.old", "myfile.file" for the input filename "myfile", and "myfile.myfile" for
the input filename ".myfile". Spaces may be included in outpattern, as in the example:
nmap $1 sed s/ *$// > $1
Use the `\' character to prevent special treatment of the `$', `[', `]', and `,' charac-
ters.
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Wed Apr 10, 2013 7:02 pm
Reply with quote

APPEND...use APPEND instead of PUT.

Make sure to check the file to see if it contains any weird characters between files.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Apr 11, 2013 12:13 am
Reply with quote

enrico-sorichetti wrote:
Quote:
Using SAS mail you can get the mainframe files as notepad file

what if the TS organization does not have SAS

Quote:
connect to MF using windows FTP.... then use Mget command to get multiple files from MF to desktop.


a plain mget/mput command will just transfer the files storing them with the same name

the TS question seems to ask on how to append a .txt extension to each one

read the manuals about the use the nmap ftp command

here is the abstract form the unix man page


Quote:
nmap [inpattern outpattern]
Set or unset the filename mapping mechanism. If no arguments are specified, the filename
mapping mechanism is unset. If arguments are specified, remote filenames are mapped during
mput commands and put commands issued without a specified remote target filename. If argu-
ments are specified, local filenames are mapped during mget commands and get commands
issued without a specified local target filename. This command is useful when connecting
to a non-UNIX remote computer with different file naming conventions or practices. The
mapping follows the pattern set by inpattern and outpattern. [Inpattern] is a template for
incoming filenames (which may have already been processed according to the ntrans and case
settings). Variable templating is accomplished by including the sequences ``$1'', ``$2'',
... ``$9'' in inpattern. Use `\' to prevent this special treatment of the `$' character.
All other characters are treated literally, and are used to determine the nmap [inpattern]
variable values. For example, given inpattern $1.$2 and the remote file name
"mydata.data", $1 would have the value "mydata", and $2 would have the value "data". The
outpattern determines the resulting mapped filename. The sequences ``$1'', ``$2'', ...
``$9'' are replaced by any value resulting from the inpattern template. The sequence
``$0'' is replaced by the original filename. Additionally, the sequence ``[seq1, seq2]''
is replaced by [seq1] if seq1 is not a null string; otherwise it is replaced by seq2. For
example, the command

nmap $1.$2.$3 [$1,$2].[$2,file]

would yield the output filename "myfile.data" for input filenames "myfile.data" and
"myfile.data.old", "myfile.file" for the input filename "myfile", and "myfile.myfile" for
the input filename ".myfile". Spaces may be included in outpattern, as in the example:
nmap $1 sed s/ *$// > $1
Use the `\' character to prevent special treatment of the `$', `[', `]', and `,' charac-
ters.


Once the files are down loaded to desktop we can run a simple batch command to append .txt to all the files

Example
Code:
for /R %x in (*.*) do ren "%x" *.txt
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Apr 11, 2013 1:03 am
Reply with quote

Quote:
Once the files are down loaded to desktop we can run a simple batch command to append .txt to all the files


did You read carefully the TS question? looks like not...

Quote:
I have thought of using mput. But not sure if this would be the correct approach.


the windoze machine is the destination of the put, most probably a <server> type of machine,
and it would be contrary to any good sense to have any human interaction on it, just to rename some files

and it would also be a very poor approach to have a FTP server running on a desktop

so it is more appropriate to do it all from the FTP <transmitter> side
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Thu Apr 11, 2013 8:03 pm
Reply with quote

Yeah, I got that wrong. I thought he wanted to put all the mainframe files into a single text file.
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
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
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
Search our Forums:

Back to Top