The environment variable names will be generate by the rexx program to be pass down to the next program. The name will have suffix "01" - "99".
This how COBOL or PL/I works on the Linux environment. From: "McKown, John" <john.mck...@healthmarkets.com> To: LINUX-390@VM.MARIST.EDU Date: 11/02/2009 05:11 PM Subject: Re: emulating a z/OS DDNAME dataset concatenation in Linux Sent by: Linux on 390 Port <LINUX-390@VM.MARIST.EDU> > -----Original Message----- > From: Linux on 390 Port [mailto:linux-...@vm.marist.edu] On > Behalf Of John Summerfield > Sent: Monday, November 02, 2009 10:18 AM > To: LINUX-390@VM.MARIST.EDU > Subject: Re: emulating a z/OS DDNAME dataset concatenation in Linux <snip> > <snip> > > If there's some useful preprocessing that could be done before the > program, he could replace cat with a program that does that processing > and reduce the overhead. > > -- > > Cheers > John What I think he wants would be the ability to set an environment variable to contain a series of file names. Then, in his code, he passes the environment variable name to some sort of "open" function. The "open" would parse out the names of the files in the variable and open the first one. Then, when a "read" is done on the file handle, the program would either get the next record in the current file; if eof, then close current, open next, read first record and return; if eof and no next file name, then return eof to the program. The following Perl code could do something like what the OP want. Assuming his program is written in Perl <grin>. #!/usr/bin/perl use strict; use warnings; my ($files,$file,@files) $files=$ENV{"FILES"}; die "FILES environment variable does not exist" unless $files; @files=split /:/$files; foreach $file (@files) { die "$file is not readable" unless -r $file; } $files=join(' ',@files); open(INPUT,"cat $files |"; while(INPUT) { # INPUT PROCESSING FOR EACH RECORD IN EACH FILE, IN ORDER. } OK, it's not perfect and using "cat" in that way is not as efficient as simply putting the files in the @ARGV array. But this could be a model for some C code or other language, perhaps. -- John McKown Systems Engineer IV IT Administrative Services Group HealthMarkets(r) 9151 Boulevard 26 * N. Richland Hills * TX 76010 (817) 255-3225 phone * (817)-961-6183 cell john.mck...@healthmarkets.com * www.HealthMarkets.com Confidentiality Notice: This e-mail message may contain confidential or proprietary information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. HealthMarkets(r) is the brand name for products underwritten and issued by the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance Company(r), Mid-West National Life Insurance Company of TennesseeSM and The MEGA Life and Health Insurance Company.SM ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 Visit our website at http://www.nyse.com **************************************************** Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext, Inc. ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390