> -----Original Message-----
> From: IBM Mainframe Discussion List 
> [mailto:[EMAIL PROTECTED] On Behalf Of Kinney, Kevin
> Sent: Thursday, October 20, 2005 9:39 AM
> To: [email protected]
> Subject: MGETing PC files with 2 nodes
> 
> 
> We're trying to do an mget on PC files.  They're in the 
> format; BLAH1.TXT,
> BLAH2.TXT, etc.  And we can't rename the PC files.  (@#$%!!)
> 
> As expected, MGETing the files errors out with a EZA1735I, rc=22226.
> 
>  
> 
> Within MVS, is there a way to retrieve these files to a PDS?
> 
>  
> 
> I suppose a workaround would be to -
> 
> 1) MGET all the PC files to a USS directory, 
> 
> 2) rename them, 
> 
> 3) transfer them from USS to the PDS and 
> 
> 4) delete the USS files.  
> 
>  
> 
> There's got to be a better way.
> 
>  
> 
> Regards,
> 
> Kevin Kinney
> 

I consider the following to be "simple". I do an ftp step which does a
"dir" to list the file names. The output is put into a MVS dataset. The
second step is a REXX program to parse the data in the MVS dataset,
creating ftp "get" commands. The third step is to use those commands to
actually get the members of the PDS.

<JCL>
//STEP1    EXEC  PGM=FTP,
//             REGION=6M,
//             PARM='(EXIT'
//SYSPRINT DD  SYSOUT=*
//OUTPUT   DD  DSN=&&OUTPUT,DISP=(NEW,CATLG),
// RECFM=VB,LRECL=2000,BLKSIZE=0,DSORG=PS,
// SPACE=(CYL,10),UNIT=SYSDA
//INPUT    DD  *
server.ip.address
server.user.id
server.user.password
cd server/sub/directory
dir
/*
//STEP2 EXEC PGM=IRXJCL,REGION=0M,PARM='FNODE'
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSEXEC DD DISP=SHR,DSN=TSH009.REXX.EXEC
//SYSIN DD DUMMY
//DIRLIST DD DSN=&&OUTPUT,DISP=(OLD,PASS)
//COMMANDS DD DSN=&&COMMANDS,DISP=(NEW,PASS),
// UNIT=SYSDA,SPACE=(CYL,10),
// DCB=(SYS1.MACLIB,DSORG=PS)
//*
//STEP3 EXEC PGM=FTP,REGION=6M,PARM='(EXIT'
//SYSPRINT DD SYSOUT=*
//INPUT DD *
server.ip.address
server.user.id
server.user.password
bin
cd server/sub/directory
lcd OUTPUT.PDS
/*
// DD DISP=(OLD,PASS),DSN=&&COMMANDS
//
</JCL>

Please note the appropriate upper/lower case!

<REXX>
/* REXX */
COUNT=0
DO FOREVER  /* ACTUALLY UNTIL THE FIRST EZA2284I MESSAGE */
   "EXECIO 1 DISKR DIRLIST"
   IF RC <> 0 THEN LEAVE
   PARSE PULL RECORD
   IF 'EZA2284I' = WORD(RECORD,1) THEN LEAVE
END
DO FOREVER /* ACTUALLY UNTIL WE RUN OUT OF EZA2284I MESSAGES */
   "EXECIO 1 DISKR DIRLIST"
   IF RC <> 0 THEN LEAVE
   PARSE PULL RECORD
   IF 'EZA2284I' <> WORD(RECORD,1) THEN LEAVE
   FN=WORD(RECORD,WORDS(RECORD)) /* GET LAST RECORD */
   DOT=POS(FN,'.') /* FIND FIRST PERIOD */
   DOT=MAX(DOT,9)  /* CAN ONLY HAVE AN 8 CHAR PDS NAME */
   IF DOT = 0 THEN PDSN=FN
   ELSE PDSN=LEFT(FN,DOT-1)
   LINE='get 'FN PDSN' (replace'
   QUEUE LINE
   "EXECIO 1 DISKW COMMANDS"
END
"EXECIO 0 DISKR DIRLIST(FINIS"
"EXECIO 0 DISKW COMMANDS(FINIS"
</REXX>

I am not sure, but if I wanted to get "fancy", I might even be able to
write a UNIX shell script to do this using pipes and other "fancy" (and
not as easy to understand) methods.

--
John McKown
Senior Systems Programmer
UICI Insurance Center
Information Technology

This message (including any attachments) contains confidential
information intended for a specific individual and purpose, and its'
content is protected by law.  If you are not the intended recipient, you
should delete this message and are hereby notified that any disclosure,
copying, or distribution of this transmission, or taking any action
based on it, is strictly prohibited.
 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to