Martin,

Thanks for clarifying what OP really wanted.

Binaymin Dissen,

Here are the answers to your questions.

Q.it is sad that DFSORT does not support the alternate DDNAME parameter).

Answer : DFSORT indeed supports alternate DDnames with option SORTDD. 
SORTDD=CCCC Specifies a four-character prefix for the ddnames to be used 
when you dynamically invoke DFSORT more than once in a program step. The 
four characters replace "SORT" in the following ddnames: SORTIN, SORTOUT, 
SORTINn, SORTINnn, SORTOFd, SORTOFdd, SORTWKd, SORTWKdd, SORTJNF1, 
SORTJNF2 and SORTCNTL. This allows you to use a different set of ddnames 
for each call to DFSORT. 

Check this link which explains in detail about SORTDD here

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1ca60/3.14

Q.I wish to sort all dsnames that fit pattern prefix.Dyyymmdd.Thhmmss. As 
these are not GDG's, JCL alone will not do the job. I need step (1), find 
the
matches, (2) create a sortin, (3) deal with more than 255 instances (or 
whatever is the DDNAME CONCAT maximum, etc. Or I can write an E15 that
allocates and reads each one at a time. And I wish an all rexx solution.I 
ended up having step (1) combine them all into one big file and then doing 
a
SORT. But it adds an extra pass across all of the data.

Answer : It is indeed possible with JCL as DFSORT can dynamically BUILD a 
JCL and submit it via INTRDR reading the LISTCAT output. we can 
dynamically create multiple steps concatenating DD's to the limit.

Here is a DFSORT JCL which will build a dynamic JCL reading the LISTCAT 
output. A brief explanation of the job.

Step0100 : Run LISTCAT with LEVEL on your HLQ. This will get the results 
like this 

READY 
  LISTCAT LEVEL('KOLUSU') NAMES 
NONVSAM ------- KOLUSU.@@@@IPCS 
     IN-CAT --- SYS1.BIG982.ICFCAT 
NONVSAM ------- KOLUSU.AAA 
     IN-CAT --- SYS1.BIG982.ICFCAT 
NONVSAM ------- KOLUSU.ABD 

...
NONVSAM ------- KOLUSU.D0125.T1859 
     IN-CAT --- SYS1.BIG982.ICFCAT 
NONVSAM ------- KOLUSU.D0322.T2359 
     IN-CAT --- SYS1.BIG982.ICFCAT 
NONVSAM ------- KOLUSU.D0325.T0859 
     IN-CAT --- SYS1.BIG982.ICFCAT 
NONVSAM ------- KOLUSU.D0326.T0859 
     IN-CAT --- SYS1.BIG982.ICFCAT 
NONVSAM ------- KOLUSU.D0326.T0959 
     IN-CAT --- SYS1.BIG982.ICFCAT 
NONVSAM ------- KOLUSU.D0326.T2359 
     IN-CAT --- SYS1.BIG982.ICFCAT 
NONVSAM ------- KOLUSU.D0327.T0859 
     IN-CAT --- SYS1.BIG982.ICFCAT 
NONVSAM ------- KOLUSU.D0327.T0959 
     IN-CAT --- SYS1.BIG982.ICFCAT 
NONVSAM ------- KOLUSU.D0327.T1059 
     IN-CAT --- SYS1.BIG982.ICFCAT 
NONVSAM ------- KOLUSU.D0327.T1159 
     IN-CAT --- SYS1.BIG982.ICFCAT 
NONVSAM ------- KOLUSU.D0327.T1259 
     IN-CAT --- SYS1.BIG982.ICFCAT 
NONVSAM ------- KOLUSU.D0327.T1359 
     IN-CAT --- SYS1.BIG982.ICFCAT 
NONVSAM ------- KOLUSU.D0327.T1459 
     IN-CAT --- SYS1.BIG982.ICFCAT 
NONVSAM ------- KOLUSU.D0327.T1559 
     IN-CAT --- SYS1.BIG982.ICFCAT 

Now our intention is to pick record with KOLUSU.Dyyy.Thhmm  names.

The DSNAME start in position 17 for a length of 44. So we will use an 
INCLUDE cond to pick all the desired records. You may need to adjust the 
positions to suit your needs here. Just change the Include cond positions.

Once we picked the desired records, we use WHEN=GROUP to tag them to 
step/concatenation limit and build a dynamic JCL. Now look at the output 
from Step0200 SORTOUT DD. It should have generated the JCL need to sort 
the records from the files that matched criteria. If the generated JCL 
looks good then change the following statement //SORTOUT  DD SYSOUT=* to 
//SORTOUT  DD SYSOUT=(*,INTRDR),RECFM=FB


//STEP0100 EXEC PGM=IKJEFT01 
//SYSTSPRT DD DSN=&&L,DISP=(,PASS),SPACE=(CYL,(25,25),RLSE), 
//            DCB=(LRECL=80,RECFM=FB,BLKSIZE=27920) 
//SYSTSIN  DD * 
  LISTCAT LEVEL('KOLUSU') NAMES 
//* 
//STEP0200 EXEC PGM=SORT 
//SYSOUT   DD SYSOUT=* 
//SORTIN   DD DISP=SHR,DSN=&&L 
//SORTOUT  DD SYSOUT=* 
//SYSIN    DD * 
  OPTION COPY 
  INCLUDE COND=(01,7,CH,EQ,C'NONVSAM',AND, 
                24,1,CH,EQ,C'D',AND, 
                25,4,FS,EQ,NUM,AND, 
                30,1,CH,EQ,C'T',AND, 
                31,4,FS,EQ,NUM,AND, 
                35,1,CH,EQ,C' ') 
 
  INREC IFTHEN=(WHEN=INIT,BUILD=(C'//',9X,C'DD DISP=SHR,DSN=',17,44)), 
  IFTHEN=(WHEN=GROUP,RECORDS=254,PUSH=(81:ID=5,SEQ=3)), 
  IFTHEN=(WHEN=(86,3,ZD,EQ,1),OVERLAY=(3:C'SORTIN')) 
 
  OUTFIL REMOVECC,BUILD=(1,80),INCLUDE=(81,5,ZD,LT,255), 
  HEADER1=('//DYNJCL01 JOB (ACCNT,INFO),''','NAME''',',',/, 
           '//             CLASS=A,',/, 
           '//             MSGCLASS=H,',/, 
           '//             MSGLEVEL=(1,1),',/, 
           '//             TIME=NOLIMIT,',/, 
           '//             NOTIFY=NAME',/, , 
           '//*'), 
  SECTIONS=(81,5, 
  HEADER3=('//STP',81,5,' EXEC PGM=SORT',/, 
           '//SYSOUT   DD SYSOUT=*'), 
  TRAILER3=('//*',/, 
            '//SORTOUT DD DSN=HLQ.STP',81,5,'.OUTPUT,',/, 
            '//           DISP=(NEW,CATLG,DELETE),',/, 
            '//           UNIT=SYSDA,',/, 
            '//           SPACE=(CYL,(X,Y),RLSE)',/, 
            '//*',/, 
            '//SYSIN    DD *',/, 
            '  OPTION DYNALLOC=(,32)',/, 
            '  SORT FIELDS=(1,10,CH,A)',/, 
            '//*')) 
//* 


Further if you have any questions please let me know

Thanks,
Kolusu
DFSORT Development
IBM Corporation



From:   Binyamin Dissen <[email protected]>
To:     [email protected], 
Date:   02/24/2014 01:59 AM
Subject:        Re: DFSort support for REXX E15?
Sent by:        IBM Mainframe Discussion List <[email protected]>



The issue is not how to invoke DFSORT thru rexx - LINKMVS works fine 
(though
it is sad that DFSORT does not support the alternate DDNAME parameter).

I wish to sort all dsnames that fit pattern prefix.Dyyymmdd.Thhmmss. As 
these
are not GDG's, JCL alone will not do the job. I need step (1), find the
matches, (2) create a sortin, (3) deal with more than 255 instances (or
whatever is the DDNAME CONCAT maximum, etc. Or I can write an E15 that
allocates and reads each one at a time. And I wish an all rexx solution.

I ended up having step (1) combine them all into one big file and then 
doing a
SORT. But it adds an extra pass across all of the data.


 On Sun, 23 Feb 2014 19:19:48 -0800 Sri h Kolusu <[email protected]> 
wrote:

:>Hi,
:>
:>Here are a couple of examples that show how to invoke DFSORT from REXX.
:>
:>
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1ca60/11.3?
:>
:>Further if you have any questions please let us know
:>
:>Kolusu
:>DFSORT Development
:>IBM Corporation
:>
:>IBM Mainframe Discussion List <[email protected]> wrote on 
:>02/23/2014 01:19:10 AM:
:>
:>> From: Binyamin Dissen <[email protected]>
:>> To: [email protected], 
:>> Date: 02/23/2014 01:19 AM
:>> Subject: DFSort support for REXX E15?
:>> Sent by: IBM Mainframe Discussion List <[email protected]>
:>> 
:>> 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
:>> 
:>
:>----------------------------------------------------------------------
:>For IBM-MAIN subscribe / signoff / archive access instructions,
:>send email to [email protected] with the message: INFO IBM-MAIN

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



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

Reply via email to