Hallo,
I have a question regarding the use of SORTOF-statement.
A SORTIN input file is splitted in several files thru a SORTOF-statement. A total of 140 files
are created that maybe will contain data. Afterwards I added an extra step to control the newly
created SORTOF files, and delete them if empty.
Not with the SPEMPTY statement, but with IDCAMS combined with PRINT statement.
I found no other method that I could use in one step...
(USE SYNCSORT 1.3.2.R)
My question:
When executing the job, we noticed an important increase in ELAPSED Time and CPU Time because of the
extra delete statement.
-> Is there a way to make use of the SORTOF-statement without allocating all the mentioned files?
In other words: Can I use the SORTOF-statement in a way that files, that are not written to, automatically
will be deleted?
Example of as-is:
//S0030 EXEC SPSORT
//* ==== INPUT FILES
//SORTIN DD DSN=sortinfile_1,
// DISP=SHR
//$ORTPARM DD *
VLTEST=0
//SORTOF01 DD DISP=(,CATLG,DELETE),LRECL=12280,RECFM=VB,EXPDT=&EXP05WD,
// DSN=sortoffile_1
//SORTOF02 DD DISP=(,CATLG,DELETE),LRECL=12280,RECFM=VB,EXPDT=&EXP05WD,
// DSN=sortoffile_2
//SORTOF03 DD DISP=(,CATLG,DELETE),LRECL=12280,RECFM=VB,EXPDT=&EXP05WD,
// DSN=sortoffile_3
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,
INCLUDE=(211,12,CH,EQ,X'004400320050005A005A0031'),
OUTREC=(1,90,491)
OUTFIL FILES=02,
INCLUDE=(211,12,CH,EQ,X'004400320050005A005A0032'),
OUTREC=(1,90,491)
OUTFIL FILES=03,
INCLUDE=(211,12,CH,EQ,X'004400320050005A005A0033'),
OUTREC=(1,90,491)
//*
//S0035 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
PRINT INDATASET ('sortoffile_1') COUNT(1)
IF LASTCC=4 -
THEN DELETE sortoffile_1 PURGE
PRINT INDATASET ('sortoffile_2') COUNT(1)
IF LASTCC=4 -
THEN DELETE sortoffile_2 PURGE
PRINT INDATASET ('sortoffile_3') COUNT(1)
IF LASTCC=4 -
THEN DELETE sortoffile_3 PURGE
SET MAXCC=0
//*
Any suggestions?
Many thanks in advance!