I did this in REXX a different way.

In my case, I wanted to produce multiple SORTOUTS but the same could apply
for multiple input files.

I used a SYSINnn DD statement and a SYSPARMnn DD.

DO I = 1 to files
CALL SYSIN(I)
CALL SYSPARMI(I)
CALL SPOOL(I)
CALL SYSPOOL(I)
CALL ALLOCA(I)
ADDRESS LINKPGM SORT
END

/*-------------------------------------------------------------------*/
/* Spool the SYSIN cards from SYSIN1-9 to SYSIN file */
/*-------------------------------------------------------------------*/
SPOOL:
arg s
/* write out the SORT statements and finish */
"EXECIO * DISKW SYSIN (STEM s"s". FINIS)"
RETURN
SYSPOOL:
arg s
/* write out the SYSPARM Statements and close SYSPARM */
"EXECIO * DISKW SYSPARM (STEM sp"s". FINIS)"
RETURN
/*-------------------------------------------------------------------*/
/* Read the SYSIN1-9 input */
/*-------------------------------------------------------------------*/
SYSIN:
arg s
sysfile = 'SYSIN's
EXECIO * DISKR "sysfile"(STEM s"s". FINIS)"
RETURN
/*-------------------------------------------------------------------*/
/* Read the SYSPARM1-9 input */
/*-------------------------------------------------------------------*/
SYSPARMI:
arg s
sysparm = 'SYSPARM's
EXECIO * DISKR "sysparm"(STEM sp"s". FINIS)"
RETURN
/*-------------------------------------------------------------------*/
/* Allocate each SORTOUT file from 1 up to 9 */
/*-------------------------------------------------------------------*/

ALLOCA:
arg s
sortnew = 'SORTOUT's
x = 'ddinfo = LISTDSI('sortnew' "FILE")'
INTERPRET x
SAY ''
SAY 'Starting sort of file ' s
SAY ''
SAY 'The data set name is: ' sysdsname
SAY 'The device unit on which the volume resides is:' sysunit
/* SAY 'The record format is: ' sysrecfm
SAY 'The logical record length is: ' syslrecl
SAY 'The block size is: ' sysblksize */
SAY 'The allocation in space units is: ' sysalloc
SAY 'Type of security protection is: ' sysracfa

"FREE F(SORTOUT) "
"ALLOC F(SORTOUT) DA("sysdsname") OLD"

RETURN


On Sun, Feb 23, 2014 at 8:19 PM, Binyamin Dissen <[email protected]
> wrote:

> I want to run a sort for a series of files that fit a dsname pattern.
>
> The simple approach would be an E15 which runs thru the list of files, and
> rexx is simpler than assembler.
>
> Seems like SYNCSORT has had that option for a while.
>
> --
> Binyamin Dissen <[email protected]>
> http://www.dissensoftware.com
>
> Director, Dissen Software, Bar & Grill - Israel
>
>
> Should you use the mailblocks package and expect a response from me,
> you should preauthorize the dissensoftware.com domain.
>
> I very rarely bother responding to challenge/response systems,
> especially those from irresponsible companies.
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>



-- 
Wayne V. Bickerdike

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to