Read the file from Unix to mainframe

IBM's Command List programming language & Restructured Extended Executor

Read the file from Unix to mainframe

Postby Brindha » Wed May 19, 2010 3:02 pm


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.


$ 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..


FTGN&FILEID this is my control card.. Inside the code is below..
cd f:/ftphome/COREMERGE/ADP
get fttest.ft@e5591.PGP 'fttest.ft@e5591.PGP' (replace
rename dorcadpdrgesi bak/dorcadpdrgesi

"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...
Posts: 4
Joined: Thu Mar 11, 2010 12:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Read the file from Unix to mainframe


Re: Read the file from Unix to mainframe

Postby MrSpock » Wed May 19, 2010 3:20 pm

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.
User avatar
Global moderator
Posts: 811
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: Read the file from Unix to mainframe

Postby Robert Sample » Wed May 19, 2010 4:44 pm

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.
Robert Sample
Global moderator
Posts: 3100
Joined: Sat Dec 19, 2009 8:32 pm
Location: Bellevue, Iowa
Has thanked: 1 time
Been thanked: 177 times

Return to CLIST & REXX


  • Related topics
    Last post