SORT assistance for setting up RC

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
biswa1811
Member
Posts: 4
Joined: Thu Mar 28, 2013 4:02 am

SORT assistance for setting up RC

Post by biswa1811 » Thu Mar 28, 2013 4:07 am

Hi,

I have a requirement as below.

There is a record of length 7 starting from column 11 with value 9999999.
When I get this record in input file I want to return RC=5 to system.

I tried below but receiving RC=0 and record is captured in output file.

//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(11,7,ZD,GT,9999998)
OUTFIL FNAMES=SHOWERR,NULLOFL=RC5
/*

Can anyone assist here? I need to acheive this by using SORT only.

Regards,
Biswa

MrSpock
Active Member
Posts: 273
Joined: Wed Jun 27, 2007 5:37 pm

Post by MrSpock » Thu Mar 28, 2013 5:08 am

Doesn't NULLOFL have to be NULLOFL=RC0, RC4 ,or RC16 only?

biswa1811
Member
Posts: 4
Joined: Thu Mar 28, 2013 4:02 am

Post by biswa1811 » Thu Mar 28, 2013 5:33 am

I set RC=4, RC=16 in JCL but still I'm getting a RC=0 only.

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Thu Mar 28, 2013 12:43 pm

Firstly, you will only get the NULLOFL return if there are no records on the OUTFIL dataset.

Secondly, you can only use the options for NULLOFL, as MrSpock has pointed out.

Do you have a trailer on the input file?

biswa1811
Member
Posts: 4
Joined: Thu Mar 28, 2013 4:02 am

Post by biswa1811 » Thu Mar 28, 2013 10:37 pm

Input is as below. There is no trailer record.

=COLS>----+----1----+----2
**************************
000001 RECORD S9999999

biswa1811
Member
Posts: 4
Joined: Thu Mar 28, 2013 4:02 am

Post by biswa1811 » Thu Mar 28, 2013 10:47 pm

I'm getting RC=0 always even though OUTFIL is not having any record.

JCL details:

//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD 9999999
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OMIT COND=(11,7,CH,EQ,C'9999999')
OUTFIL FNAMES=SORTOUT,NULLOFL=RC4
/*

J E S 2 J O B L O G:

PROCSTEP RC
STEP1 00

BROWSE - SYSOUT:

SYSIN :
SORT FIELDS=COPY
OMIT COND=(11,7,CH,EQ,C'9999999')
OUTFIL FNAMES=SORTOUT,NULLOFL=RC4
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER073I SORTIN : DSNAME=UNAYABX.UNAYABX1.JOB58794.D0000101.?
WER110I SORTOUT : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER074I SORTOUT : DSNAME=UNAYABX.UNAYABX1.JOB58794.D0000104.?
WER055I INSERT 0, DELETE 1
WER405I SORTOUT : DATA RECORDS OUT 0; TOTAL RECORDS OUT 0
WER054I RCD IN 1, OUT 0
WER169I RELEASE 1.4 BATCH 0520 TPF LEVEL 0.1
WER052I END SYNCSORT - UNAYABX1,STEP1,,DIAG=8600,40CA,AA84,00E6,CE6A,68E3,AEC8

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Fri Mar 29, 2013 1:02 am

Change the SORTOUT ddname to something else (other than SORTOUT) and you should get the specified rc.

Make sure to change the OUTFIL statement as well.
Have a good one

MrSpock
Active Member
Posts: 273
Joined: Wed Jun 27, 2007 5:37 pm

Post by MrSpock » Fri Mar 29, 2013 2:28 am

It might have been helpful if you had mentioned that you were using Syncsort. Anyway, from the manual:

The NULLOFL parameter specifies the action to be taken when any non-SORTOUT OUTFIL
data set contains no data records. NULLOFL is ignored in a BetterGener application.
RC0 The delivered default instructs MFX to issue a return code of 0 if not overridden by
a higher return code set for another reason.
RC4 Instructs MFX to issue a WER461I warning message and continue processing. A
return code of 4 will be issued if not overridden by a higher return code set for
another reason.
RC16 Instructs MFX to issue a WER461A message and to terminate processing with a
return code of 16.

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Fri Mar 29, 2013 4:01 am

For SORTOUT you have to use NULLOUT. For non-SORTOUT OUTFIL, you use NULLOFL.

You cannot set the RC to 5.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others