On Tue, 25 Feb 2014 08:43:05 -0800, Sri h Kolusu wrote:

>..., it is quite easy to generate
>another dynamic JCL to MERGE(Since the SORTING is already done) all these
>into a single dataset in the same job I have shown.
>
>Either way isn't it true for any utility about the concatenation limits
>unless OP writes a program to perform a SORT(bubble..) inside the program?
> 
OK.  Here's my highly Rexx-centric approach.  It allocates only one data set
at a time, freeing it to allocate the next one.

It uses no temporary disk files other than what DFSort may use, and I
trust DFSort to do that very wisely.

It invokes IEBGENER for each input data set.  I hope that if IEBGENER is
in LPA the overhead is tolerable.  And, no, I don't perform a SORT(bubble..)
inside the program.  I trust DFSort to do that much better than I could.

Two Rexx EXECs.  Invoke the combination with "generpipe | pipesort".

user@HOST: head -99 generpipe pipesort                                          
             
==> generpipe <==
/* Rexx */ signal on novalue; /* ***************************
   Doc: Use IEBGENER to dynamically concatenate an unlimited
        number of data sets.
*/
SYSRC = SYSCALLS( 'ON' )
address 'SYSCALL'
'dup 1'  /* Alias for stdout.  */
stdout = RETVAL
'dup2 2 1'  /* Redirect Rexx output.  */
trace R
say 'stdout saved in' stdout

RC = BPXWDYN( 'alloc dd(SYSPRINT) filedata(TEXT)' ,
    'path(''/dev/fd/1'')        pathopts(OWRONLY) reuse msg(WTP)' )
RC = BPXWDYN( 'alloc dd(SYSIN)    filedata(TEXT)' ,
    'path(''/dev/./null'')      pathopts(ORDONLY) reuse msg(WTP)' )
RC = BPXWDYN( 'alloc dd(SYSUT2) filedata(RECORD)' ,
    'path(''/dev/fd/'stdout''') pathopts(OWRONLY) reuse msg(WTP)' )

/* Arbitrary sample data sets.  Or, the names could be read from a file;
   perhaps from output of LISTDS.
*/
call PipeIt 'SYS1.MACLIB(ACI)'
call PipeIt 'SYS1.MACLIB(ATLAS)'
call PipeIt 'SYS1.MACLIB(BDTDACKN)'
/* ... (more ad lib. ... */
return( RC )

PipeIt:
    RC = BPXWDYN( 'alloc dd(SYSUT1) shr dsn('''arg( 1 )''') reuse msg(WTP)' )
    address 'LINKMVS' 'IEBGENER'
    return( RC )
/* ********************************************************* */

==> pipesort <==
/* Rexx */ signal on novalue; /* ***************************
   Doc: Use stdin as SORTIN; stdout as SORTOUT.
*/
SYSRC = SYSCALLS( 'ON' )
address 'SYSCALL'
'dup 1'  /* Alias for stdout.  */
stdout = RETVAL
'dup2 2 1'  /* Redirect Rexx output.  */
trace R
say 'stdout saved in' stdout

RC = BPXWDYN( 'alloc dd(SYSOUT)   filedata(TEXT)' ,
    'path(''/dev/fd/1'')        pathopts(OWRONLY) reuse msg(WTP)' )

RC = BPXWDYN( 'alloc dd(SYSIN)                    reuse msg(WTP)' )
L.1 = '  SORT FIELDS=(73,8,CH,A)'  /* Sort by seqence number field.  */
address 'MVS' 'EXECIO 1 DISKW SYSIN (finis stem L.'

RC = BPXWDYN( 'alloc dd(SORTOUT)   filedata(TEXT)' ,
    'path(''/dev/fd/'stdout''') pathopts(OWRONLY) reuse msg(WTP)' )
RC = BPXWDYN( 'alloc dd(SORTIN)    filedata(RECORD)' ,
    'recfm(F,B) lrecl(80) blksize(8000)' ,
    'path(''/dev/fd/0'')        pathopts(ORDONLY) reuse msg(WTP)' )

address 'LINKMVS' 'ICEMAN'
return( RC )
/* ********************************************************* */
user@HOST: 

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to