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
//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)
/*
//*
//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)
/*