FTP PDS MEMBERS

Post anything related to mainframes (IBM & UNISYS) if not fit in any of the above categories

FTP PDS MEMBERS

Postby rayngerfan » Sat Sep 05, 2009 9:45 pm

To Whom It May Concern

I'm trying to FTP all the members (10) in a PDS with each member having an extention of .txt

EX: PDS member is ABEND, after the transfer , ABEND.TXT

I'm using MGET * and the 10 members do get copied to the 'C' drive, but not with the .TXT extension.

I can use the 'GET' command and transfer 1 member @ a time and add the .TXT extension.

EX: GET 'TBRIRAN.TEST.PDS(MEMBER)' C:\RICH\MEMBERNAME.TXT

Is it possible to use the MGET * command and have all 10 members transfered to the 'C' drive with a .TXT extention?

Thanks
rayngerfan
 
Posts: 51
Joined: Fri Apr 17, 2009 4:57 pm

Re: FTP PDS MEMBERS

Postby MrSpock » Sun Sep 06, 2009 1:41 am

rayngerfan wrote:Is it possible to use the MGET * command and have all 10 members transfered to the 'C' drive with a .TXT extention?


Nope. Do the HELP command for the MGET command and you'll see that you can't specify a target filename.

Don't know what you want to do. Since this is a mainframe forum, I don't want do delve into PC programming, but I would imagine that you might be able to write some sort of script that can do the 10 GET commands for you. Or move those members out of the PDS to appropriately named sequential datasets. Or if you have PKZIP zip them into a singe .zip archive with the filenames you need. Or find some other way to do what you need. Do you have corporate FTP servers where you could run jobs and FTP the files to?
User avatar
MrSpock
Global moderator
 
Posts: 811
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA

Re: FTP PDS MEMBERS

Postby rayngerfan » Sun Sep 06, 2009 6:17 am

Thanks for your quick response.

I can transfer the 10 members from the PDS to my C drive, but the 10 members don't have any extention and I have to manually rename each member with a .TXT extention. Once the members are renamed with the .TXT, I can open the member to view the text. Once I have the 10 members on the C drive, they will be copied to a CD.

Would it be possible to execute a mainframe batch job to FTP an entire PDS to my C drive with a .TXT extention?

I run the FTP.EXE program which asked for my mainframe ID & PW. Once i'm logged on I issue these commands.

ftp> CD 'TBRIRAN.TEST.PDS'
250 The working directory "TBRIRAN.TEST.PDS" is a partitoned data set
ftp> LCD C:\RICHARD
Local directory now C:\RICHARD
ftp> MGET *

The members in TBRIRAN.TEST.PDS get copiied to the C drive, but not with an .TXT extention
Thanks
rayngerfan
 
Posts: 51
Joined: Fri Apr 17, 2009 4:57 pm

Re: FTP PDS MEMBERS

Postby enrico-sorichetti » Sun Sep 06, 2009 11:32 am

do not double post,
You will not get double answers of the same quality, or the same number with a double quality :D
regards
Enrico
enrico-sorichetti
 
Posts: 2185
Joined: Fri Apr 18, 2008 11:25 pm

Re: FTP PDS MEMBERS

Postby enrico-sorichetti » Sun Sep 06, 2009 11:37 am

try to play around with the nmap command...
something along the lines nmap $1 $1.txt

quoting for the FTP man page
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 pro-
cessed according to the ntrans and case settings). Variable templat-
ing 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 replace 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 `,' characters.
regards
Enrico
enrico-sorichetti
 
Posts: 2185
Joined: Fri Apr 18, 2008 11:25 pm

Re: FTP PDS MEMBERS

Postby rayngerfan » Sun Sep 06, 2009 9:05 pm

Thanks for your response.

I wasn't trying to double post the question, just trying to provide the most detailed information about my question.

Thanks again for your help.
rayngerfan
 
Posts: 51
Joined: Fri Apr 17, 2009 4:57 pm

Re: FTP PDS MEMBERS

Postby rayngerfan » Mon Sep 07, 2009 6:39 pm

I found the answer to my question. After the members are transferred via FTP to C:\RICHARD, log off the FTP sever and go to the DOS command prompt and enter the rename command.

ren *.* *.txt

All the members in C:\RICHARD folder were renamed with a .txt extention.

When you log onto DOS, you might have to change the directory via the CD command.

I transferred the PDS members to C:\RICHARD
When I logged onto DOS I issued this command CD C:\RICAHRD
Then I issued ren *.* *.txt command and all the members had an extention of .txt

Thanks for all that responded to my question.
rayngerfan
 
Posts: 51
Joined: Fri Apr 17, 2009 4:57 pm


Return to All other Mainframe Topics

 


  • Related topics
    Replies
    Views
    Last post