Page 1 of 1

Read the file from Unix to mainframe

PostPosted: Wed May 19, 2010 3:02 pm
by Brindha
Hi,

The below are the requirements:

1) In Unix i have a list of around 5 files in one directory. from that I need to pick one file and assign the file name to one variable in mainframe. Because i need the file name in mainframe for one of my control card in the proc.

Example:

FULLAUTO@STPNASCOFTP1 /cygdrive/f/ftphome/IHEALFTP/CDHP/bak
$ ls -lrt
total 1868
-rwxrwxrwx 1 IHEAL None 208547 May 19 02:29 ebcbs_daily_incoming_0
-rwxrwxrwx 1 IHEAL None 234991 May 19 02:29 ebcbs_daily_incoming_1
-rwxrwxrwx 1 IHEAL None 128013 May 19 02:29 ebcbs_daily_incoming_2
-rwxrwxrwx 1 IHEAL None 207946 May 19 02:29 ebcbs_daily_incoming_3
-rwxrwxrwx 1 IHEAL None 152654 May 19 02:29 ebcbs_daily_incoming_4


2) The Unix file need to be assigned in a particular place in control card.


Example: In a proc i have a step like the below..

//GETNASCO EXEC PGM=FTP,PARM='(EXIT=8',COND=(0,NE)
//*
//SYSPRINT DD SYSOUT=*
//NETRC DD DSN=&NETRC(&ENCRBOX),DISP=SHR
//OUTPUT DD SYSOUT=*
//INPUT DD DSN=&PRODCARD(FTGN&FILEID),DISP=SHR
//*

FTGN&FILEID this is my control card.. Inside the code is below..

stpnascoftp1.empireblue.com
cd f:/ftphome/COREMERGE/ADP
bin
get fttest.ft@e5591.PGP 'fttest.ft@e5591.PGP' (replace
rename dorcadpdrgesi bak/dorcadpdrgesi
QUIT

"dorcadpdrgesi" is a Unix file name. Now this is acting as a static file. Now i want to change this as a dynamic file.

Could any one please help me on this..

If any doubt in the question let me know.. will make it more clear...

Re: Read the file from Unix to mainframe

PostPosted: Wed May 19, 2010 3:20 pm
by MrSpock
I think I get the concept - you have a list of files on the remote server. You'll, I presume, use FTP with either a LS or DIR command to retrieve the file directory list. You'll be using that information in your FTP process. From this point on I don't really know what the question is.

Re: Read the file from Unix to mainframe

PostPosted: Wed May 19, 2010 4:44 pm
by Robert Sample
You'll have to do an FTP to get the directory output (there is an FTP option on z/OS to route this output to a file), then you will need to write a program in some language to parse the FTP output and select out the file name you need, use the program code to generate your JCL to move the file, and then submit it to the mainframe.