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

Multiple file transfer from Unix via mainframe to LAN


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

New User


Joined: 24 May 2012
Posts: 4
Location: United Kingdom

PostPosted: Fri May 25, 2012 8:05 pm
Reply with quote

Hi. I am not sure if this has been done elsewhere, but I am looking for a proof of concept!

The challenge is to get a variable number of files from an FTP server, via the mainframe, and then onto a LAN directory. The solution we are proposing is as follows

1. Get a list of the file names existing on the FTP server using the ls command.
2. Build the FTP commands to transfer the files to the mainframe, dynamically allocating the mainframe files.
3 Listcat the mainframe files.
4. build the Connect:Direct commands into a dataset using the Listcat for the mainframe files and the ls listing for the file names on the LAN directory (as they have to be the original file names!)
5 Use the RUN JOB(DSN=nnnn) command to execute the Connect:Direct transfer

I cannot see that this would not be technically possible, just want some re-assurance that I am going in the right direction
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri May 25, 2012 8:37 pm
Reply with quote

Hello and welcome to the forum,

You should be able to do what you propose. . . .

I'm not sure why the RUN JOB is mentioned - it is not even used many places. Once JCL and control statements have been created, many would use the Internal Reader. Or create an entry in the scheduling system that when a particular dataset is created, the ftp job is run.

Probably i'm missing something.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri May 25, 2012 8:56 pm
Reply with quote

You could avoid having to use LISTCAT if you stored those files as PDS members. Just a thought.
Back to top
View user's profile Send private message
David Casson

New User


Joined: 24 May 2012
Posts: 4
Location: United Kingdom

PostPosted: Tue May 29, 2012 7:34 pm
Reply with quote

You are quite correct that I don't need the LISTCAT as the mainframe filenames are already built into the FTP GET process. I just need to extract the file names from here to build into the ConnectDirect command structure.
Having said that, I am still having a bit of trouble running the process. I tried building all the commands into a dataset and then using RUN JOB, but that is not allowed as this command can only be done from within a PROCESS. Tried running from within the PROC, but got more command errors.
Here is what I have so far
Code:
//CDSEND   EXEC CDSEND,PRIVPROC='NUTSO.CASSOND.DATA'   
   SIGNON USERID=#USER                                 
   SUBMIT PROC=CDDG063 -                               
   MAXDELAY=QUEUED                                     
   SIGNOFF             


PROC is:-

Code:
CDDG063  PROCESS  SNODE=APPL032GCD           
                                             
COPYSTEP COPY -                               
  FROM (PNODE DSN=&&MVSDSN DISP=SHR) -       
  TO   (SNODE DSN=&&DSN2 DISP=RPL)           
                                             
PROCSTEP RUN JOB(                    -       
           DSN=NUZ1D.PUNDG063.JNR.FILE1.CD  -
                )                     

NUZ1D.PUNDG063.JNR.FILE1.CD is:-

&&MVSDSN=NUZ1D.PUNDG061.JNR.ORI.S000001                               -
&&DSN2=\'\\VIA\\LIFE\\BS\\SD\\SD\\UnisureDevelopment\             ||  -
       \\\CONFIDENTIAL\                                           ||  -
       \\\JNR_TK123456_120528121854_R1234.csv'\                         
&&MVSDSN=NUZ1D.PUNDG061.JNR.ORI.S000002                               -
&&DSN2=\'\\VIA\\LIFE\\BS\\SD\\SD\\UnisureDevelopment\             ||  -
       \\\CONFIDENTIAL\                                           ||  -
       \\\JNR_TK234567_120528121854_R2345.csv'\                         
&&MVSDSN=NUZ1D.PUNDG061.JNR.ORI.S000003                               -
&&DSN2=\'\\VIA\\LIFE\\BS\\SD\\SD\\UnisureDevelopment\             ||  -
       \\\CONFIDENTIAL\                                           ||  -
       \\\JNR_TK345678_120528121854_R3456.csv'\                         
&&MVSDSN=NUZ1D.PUNDG061.JNR.ORI.S000004                               -
&&DSN2=\'\\VIA\\LIFE\\BS\\SD\\SD\\UnisureDevelopment\             ||  -
       \\\CONFIDENTIAL\                                           ||  -
       \\\JNR_TK456789_120528121854_R4567.csv'\                         
&&MVSDSN=NUZ1D.PUNDG061.JNR.ORI.S000005                               -
&&DSN2=\'\\VIA\\LIFE\\BS\\SD\\SD\\UnisureDevelopment\             ||  -   
\\\CONFIDENTIAL\                                                  ||  -      \\\JNR_TK567890_120528121854_R5678.csv'\     


Error returned is
SCBI003I
(Note that the cut&paste has not kept the allignment!)
Can anyone spot where this is wrong?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 29, 2012 8:06 pm
Reply with quote

Hello,

Quote:
(Note that the cut&paste has not kept the allignment!)
Yup, this is the "way copy/paste works". To preserve alignment (and improve readdability) use the Code tag (your post has been "Code'd"), but i don't know if the alignment is correct . . .

Have you read about the SCBI003I? I don't "do" NDM (ConnectDirect), but i suspect the message is documented.
Back to top
View user's profile Send private message
David Casson

New User


Joined: 24 May 2012
Posts: 4
Location: United Kingdom

PostPosted: Tue May 29, 2012 8:23 pm
Reply with quote

Looking at my previous post, most of the allignment is correct, but in the first line of the commands the final '-' should be level with the others and it does not seem to have wrapped the final 'confidential' line correctly. These all appear in alignment in my built commands. I have a sneaking suspicion that I may need to do the SUBMIT PROC for each of the seperate file commands!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 29, 2012 8:37 pm
Reply with quote

Hopefully, i've gotten things back in alignment - if not just post a reply and we'll have another go.

When posting data, jcl, code, etc the Code tag uses a fixed font. Regular type uses a proportiaonal font so alignment is lost. Personally, i like the green on black of the Code'd text.

There is a Preview function so you can see your post as it will appear to the forum. When it appears as you wish, Submit.
Back to top
View user's profile Send private message
David Casson

New User


Joined: 24 May 2012
Posts: 4
Location: United Kingdom

PostPosted: Wed May 30, 2012 4:06 pm
Reply with quote

Have finally sussed this! Have to build the entire Connect:Direct command stream into a dataset using ICETOOL. Then it is simply a case of including the dataset as a PARMSIN parameter when executing Connect:Direct

Code:
//CDSEND   EXEC CDSEND,PRIVPROC='NUTSO.CASSOND.DATA', 
//         PARMSIN='NUZ1D.PUNDG063.JNR.FILE1.CD'       
//*                                                   
//INTRDR   DD  SYSOUT=*                               
//NDMCMDS  DD  SYSOUT=*                               
//*                                                   
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed May 30, 2012 10:04 pm
Reply with quote

Good to hear you have this working - thank you for posting the solution icon_smile.gif

d
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 FTP VB File from Mainframe retaining ... JCL & VSAM 4
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
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top