# Need to set RC4 through JCL SORT

Author Message
rajesh7523

New User

Joined: 15 Dec 2022
Posts: 8
Location: BHOPAL

Posted: Wed Apr 03, 2024 2:29 pm

Hi All,

I want to set the return code =04 only if below sort logic satisfy, and if it didnt have duplicates or not satisfy the sort condition then RC00

SORT FIELDS=(1,24,CH,A),EQUALS
SUM FIELDS=NONE

here is my job

 Code: //STEP020B EXEC  PGM=SORT                                    //SYSOUT   DD  SYSOUT=*                                      //SORTIN   DD  DSN=TEST.CBS.ROJ1.IDOC0410.MASTER.WORK1,      //             DISP=SHR                                      //SORTOUT  DD  DSN=TEST.CBS.ROJ1.DLS.IDOC0410.MASTER.D0307, //             DISP=(NEW,CATLG,DELETE),                      //             UNIT=SYSDA,                                  //             SPACE=(TRK,(4000,400),RLSE),                  //             DCB=(MODELDCB,RECFM=FB,LRECL=3728,BLKSIZE=0) //SYSIN    DD  *                                             SORT FIELDS=(1,24,CH,A),EQUALS                               SUM FIELDS=NONE                                            /*

This is my requirement because, I want to execute the next steps only if it satisfies else it should skip the next steps. if we set the RC then condition check in next step we can execute or skip

Also i tried to set RC04 with IDCAMS, it is working with out sortlogic not with it.

Joerg.Findeisen

Senior Member

Joined: 15 Aug 2015
Posts: 1269
Location: Bamberg, Germany

 Posted: Wed Apr 03, 2024 3:07 pm So RC04 if dups, RC00 if no dups? The other condition makes no sense.
rajesh7523

New User

Joined: 15 Dec 2022
Posts: 8
Location: BHOPAL

 Posted: Wed Apr 03, 2024 4:55 pm yahh i need to setup the RC based on the satisfying condition. any one pls help me with the sort logic
Joerg.Findeisen

Senior Member

Joined: 15 Aug 2015
Posts: 1269
Location: Bamberg, Germany

 Posted: Wed Apr 03, 2024 5:44 pm See ICETOOL COUNT operator with EMPTY/NOTEMPTY. You can set RC4/RC8 or RC12 in this case.
sergeyken

Senior Member

Joined: 29 Apr 2008
Posts: 2030
Location: USA

Posted: Wed Apr 03, 2024 6:38 pm

 rajesh7523 wrote: Also i tried to set RC04 with IDCAMS, it is working with out sortlogic not with it.

IDCAMS and SORT are two separate and independent utility programs. The difference is the same as between a train, and a plane.

You cannot use a train ticket to board a plane.
In the same manner you cannot "set RC04 in IDCAMS" to "start working with sort logic"
Rohit Umarjikar

Global Moderator

Joined: 21 Sep 2010
Posts: 3055
Location: NYC,USA

 Posted: Sat Apr 06, 2024 1:05 am Add another step to the proc or job and use output data set from the mentioned step above and set rc to 04 if empty to decide what action to perform in subsequent steps. www.ibmmainframeforum.com/jcl/topic7327-10.html
 View Bookmarks All times are GMT + 6 Hours

 Topic Forum Replies Similar Topics How to split large record length file... DFSORT/ICETOOL 10 JCL sort card - get first day and las... JCL & VSAM 9 Sort First/last record of a subset th... DFSORT/ICETOOL 7 how to calculate SUM value for VB fil... DFSORT/ICETOOL 1 how to calculate SUM for VB file usin... JCL & VSAM 1
Search our Forums:

 IBMMainframes.com is not an official and/or affiliated with IBM® in anyway Board Rules | FAQ | Downloads | Wiki | SiteMap | Contact Us