Minoru Massaki, It is quite simple to set a return code using COUNT operator. Here are a couple of ways setting the RC=4 . You can also set RC8 and RC12 too.
//STEP0100 EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //IN DD * A //TOOLIN DD * COUNT FROM(IN) NOTEMPTY RC4 //* or //STEP0100 EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //IN DD * //TOOLIN DD * COUNT FROM(IN) HIGHER(0) RC4 //* Check this link which explains in about COUNT operator and check out the examples too. https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.icea100/ice2ca_COUNT_operator.htm >>I would say, no, you cannot have DFSORT do something like this. I am not seeing anything the DFSORT manuals from IBM to allow the user to force DFSORT to set codes other than it is already doing. Lizette, Sorry to say that you are wrong. DFSORT does have the capability. we can handle different scenarios. EMPTY/NOTEMPTY and "n" number of records too >>Pretty trivial to write Rexx to set a return code based on file empty/Not empty. DFSORT already handles these scenarios. Thanks, Kolusu DFSORT Development From: Minoru Massaki <mmass...@gmail.com> To: IBM-MAIN@LISTSERV.UA.EDU Date: 04/15/2017 08:03 AM Subject: How can I set Non-zero return code in DFSORT when SORTOUT record count is not zero Sent by: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> Hello I'm looking for a way to set Non-zero return code in DFSORT, when record count of SORTOUT is not zero. I know that setting non-zero return code when SORTOUT record count is zero. Your help would be highly appreciated. -- 全先 実 - Minoru Massaki (M*M) E-mail: mmass...@gmail.com ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN