Use of temporary datasets between two successive sorts



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Use of temporary datasets between two successive sorts

Postby golemis » Wed Jul 11, 2018 5:31 pm

Hi,
I need to perform two successive sorts, using the result of the 1st as SORTIN to the second (to avoid questions, the sort field in not in a fixed position in the initial dataset, so I use the first sort to rearrange the layout with INTHEN(WHEN s and then the second sort to do the required sorting).
When I use a permanent dataset, to link the two sorts, everything works fine.
When I substitute this permanent dataset witha temporary one, the second sort succeeds, no complain or CR>0, but works as if the temp dataset was empty !
    ICE080I 0 IN MAIN STORAGE SORT
    ICE055I 0 INSERT 0, DELETE 0
    ICE054I 0 RECORDS - IN: 0, OUT: 0
    ICE173I 0 NO RECORDS FOR THE SORTOUT DATA SET - RC=0
Any idea what I am doing wrong ?

//PD0001S1 EXEC PGM=SORT
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSLIST  DD SYSOUT=*
//SORTIN   DD DISP=SHR,DSN=HLQ.D040718.LOG
//SORTOUT  DD SYSOUT=*
//TEMPC    DD DSN=&TEMPC,DISP=(,PASS),
//         SPACE=(CYL,(1,5),RLSE),UNIT=SYSDA,
//         DCB=(RECFM=FB,LRECL=110)
//SYSIN    DD *
   SORT FIELDS=(15,8,CH,A)
   INCLUDE COND=(1,12,CH,EQ,C'JobComplete;')
   OUTREC IFTHEN=(WHEN=(25,1,CH,EQ,C' '),
     BUILD=(42,8,X,15,8,X,51,89,3X)),
          IFTHEN=(WHEN=NONE,
     BUILD=(41,8,X,15,8,X,50,90,2X))
   OUTFIL FNAMES=TEMPC
/*
//PD0001S2 EXEC PGM=SORT
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSLIST  DD SYSOUT=*
//SORTIN   DD DISP=(,DELETE),DSN=*.PD0001S1.TEMPC,
//         DCB=(RECFM=FB,LRECL=110)
//SORTOUT  DD SYSOUT=A
//SYSIN    DD *
   SORT FIELDS=(1,8,CH,A)
/*
golemis
 
Posts: 34
Joined: Wed Apr 04, 2018 8:13 pm
Location: London, UK
Has thanked: 10 times
Been thanked: 0 time

Re: Use of temporary datasets between two successive sorts

Postby Robert Sample » Wed Jul 11, 2018 5:59 pm

Your SORTIN for the second step will use the default for status -- which is NEW. When you attempt to read a record from a DISP=(NEW,DELETE) data set, what do you think happens?

These users thanked the author Robert Sample for the post:
golemis (Wed Jul 11, 2018 6:20 pm)
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Use of temporary datasets between two successive sorts

Postby golemis » Wed Jul 11, 2018 6:20 pm

Thank you Robert, my bad, just added (OLD,DELETE) and all good now
golemis
 
Posts: 34
Joined: Wed Apr 04, 2018 8:13 pm
Location: London, UK
Has thanked: 10 times
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post