My very own local sysprog came up with the ideal solution. //TC33COPY JOB NOTIFY=&SYSUID //CONDCOPY EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * PRINT INFILE(TC33IN) CHAR COUNT(1) IF LASTCC = 0 THEN REPRO INFILE(TC33IN) OUTFILE(TC33OUT) ELSE IF LASTCC = 4 THEN SET MAXCC=0 /* //TC33IN DD DISP=SHR,DSN=PROD.VISAEP4.TC33EX //TC33OUT DD DSN=DEV.CVSC.TC33EX, // DISP=SHR, // LIKE=PROD.VISAEP.TC33EX
Results: IDCAMS SYSTEM SERVICES PRINT INFILE(TC33IN) CHAR COUNT(1) IDCAMS SYSTEM SERVICES LISTING OF DATA SET -PROD.VISAEP4.TC33EX IDC11462I REQUESTED RANGE END BEYOND END OF DATA SET. IDC0005I NUMBER OF RECORDS PROCESSED WAS 0 IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 4 IDCAMS SYSTEM SERVICES IF LASTCC = 0 THEN REPRO INFILE(TC33IN) OUTFILE(TC33OUT) IDC0204I PRECEDING COMMAND BYPASSED DUE TO CONDITION CODES ELSE IF LASTCC = 4 THEN SET MAXCC=0 IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 0 Exactly what I was looking for. Thanks Bill!! Frank >________________________________ > From: Frank Swarbrick <[email protected]> >To: [email protected] >Sent: Thursday, April 19, 2012 12:16 PM >Subject: Re: DFSORT, no records for SORTOUT > >That works. Thanks! I've not used ICETOOL before. >One minor thing. I wish I could skip steps (or conditionally execute them) >rather than having the job set RC12. Something like how IDCAMS works: > > COUNT FROM(TC33IN) EMPTY RC4 > > IF LASTCC = 0 > THEN > COPY FROM(TC33IN) TO(TC33OUT) ELSE > IF LASTCC = 4 > THEN SET MAXCC=0 > > >Oh well! > >Thanks again, >Frank > > > > > >>________________________________ >> From: Frank Yaeger <[email protected]> >>To: [email protected] >>Sent: Thursday, April 19, 2012 11:38 AM >>Subject: Re: DFSORT, no records for SORTOUT >> >>Frank Swarbrick at IBM Mainframe Discussion List <[email protected]> >>wrote on 04/19/2012 10:22:56 AM: >>> I know of the NULLOUT and NULLOFL options to specify return code >>> setting if there are no records to be written to the output file. >>> I'm wondering if there is any option I can specify so that the >>> SORTOUT file will not even be opened if there are no records to be >>> written to it. Basically, I want to leave the "old" records that >>> were in SORTOUT alone if there is nothing new to go in to it for this >>run. >>> >>> At this point the best thing I can think of is to run SORT twice; >>> the first time copying one record to a dummy file with NULLOUT=RC4 >>> set. Then skipping step 2, the actual copy into the real SORTOUT, >>> if the RC from step 1 is not 0. >>> >>> If there is a program other than SORT (IDCAMS?) that I can use to >>> accomplish this, that's fine as well. No actual sorting is being >>> done; just a straight copy. >> >>Frank, >> >>You could use a DFSORT ICETOOL job with COUNT and COPY like this: >> >>//S1 EXEC PGM=ICETOOL >>//TOOLMSG DD SYSOUT=* >>//DFSMSG DD SYSOUT=* >>//IN DD DSN=... input file >>//OUT DD DSN=... output file >>//TOOLIN DD * >>MODE STOP >>COUNT FROM(IN) EMPTY RC12 >>COPY FROM(IN) TO(OUT) >>/* >> >>If IN is emtpy, the COUNT operator will set RC=12 and >>the COPY operator will NOT be executed so OUT will not be >>opened. The step will give back cc=12. COUNT does not >>require an output data set. >> >>If IN is not empty, the COUNT operator will set RC=0 and >>the COPY operator will be executed so OUT will be >>opened and IN will be copied to it. The step will give >>back cc=0 >> >>Note that MODE STOP is the default so you don't have to >>specify it, but I put it in for doc purposes. >> >>Frank Yaeger - DFSORT Development Team (IBM) - [email protected] >>Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration >> >>=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort >>---------------------------------------------------------------------- >>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 > > > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN

