Set Return Code using DFSORT
Moderators: Frank Yaeger, Moderator Group
-
- Member
- Posts: 4
- Joined: Tue Apr 03, 2007 10:42 pm
Set Return Code using DFSORT
Hi All,
I need to set a return code if the input dataset contains only header and trailer record, ie., record count = 2.
I have referred the manuals to find COUNT with EQUAL option, but it sets a return code of 4 or 12.
But I need to set a return code other than the standard return codes like 4,8,12,18 etc.
My requirement is to set the return code as 1234, is this possible through DFSORT ?
Please help !!!
Thanks,
Raveendra.
I need to set a return code if the input dataset contains only header and trailer record, ie., record count = 2.
I have referred the manuals to find COUNT with EQUAL option, but it sets a return code of 4 or 12.
But I need to set a return code other than the standard return codes like 4,8,12,18 etc.
My requirement is to set the return code as 1234, is this possible through DFSORT ?
Please help !!!
Thanks,
Raveendra.
Raveendra,
Do you just want to set the RETURN-CODE if the record count = 2 ,
Assumption:
**********
you does not want to check if the 2 records are header and trailer.
Ok lets assume the file always contians header and trailer. So if
we have 2 records then it means only header and trailer.
And do you want to copy the records into outfile or do you just want to
set RETURN-CODE??
Thanks,
Veera.
Do you just want to set the RETURN-CODE if the record count = 2 ,
Assumption:
**********
you does not want to check if the 2 records are header and trailer.
Ok lets assume the file always contians header and trailer. So if
we have 2 records then it means only header and trailer.
And do you want to copy the records into outfile or do you just want to
set RETURN-CODE??
Thanks,
Veera.
-
- Member
- Posts: 4
- Joined: Tue Apr 03, 2007 10:42 pm
Hi Veera,
Thanks for your time..
I have a SORT step which takes this as input and sorts it based on certain fields and writes into an output file.
I wanted this step to return a return-code of 1234.
Thanks,
Raveendra.
Thanks for your time..
Yes !!! Your assumption is correct. If record count is 2, then they are header and trailer. I need to set a return-code of 1234.Do you just want to set the RETURN-CODE if the record count = 2
And do you want to copy the records into outfile or do you just want to
set RETURN-CODE??
I have a SORT step which takes this as input and sorts it based on certain fields and writes into an output file.
I wanted this step to return a return-code of 1234.
Thanks,
Raveendra.
Raveendra,
As u said in ur first post looks like RC Can be used to set RC=12,
RC=4 or RC=0. I am not sure if we can set user defined RC.
Well i will try to get back if there is any means to do it.
I AM JUST CURIOS AS WHY YOU WANT TO SET TO SOME USER DEFINED
VALUE, BECAUSE USING COND PARAMETERS WE CAN CONTROL THE
FLOW OF JOB, and setting userdefined can be done using a cobol regsiter
RETURN-CODE i guess if we code a PGM.
Well lets see if there is a way to handle this using any utility.
Thanks,
Veera
As u said in ur first post looks like RC Can be used to set RC=12,
RC=4 or RC=0. I am not sure if we can set user defined RC.
Well i will try to get back if there is any means to do it.
Code: Select all
STEP001 EXEC PGM=ICETOOL
**************************************************
TOOLMSG DD SYSOUT=*
DFSMSG DD SYSOUT=*
INPFILE DD DISP=SHR,
DSN=ABCD.TEST.INPUTFILE
TOOLIN DD *
COUNT FROM(INPFILE) EQUAL(2) RC4
VALUE, BECAUSE USING COND PARAMETERS WE CAN CONTROL THE
FLOW OF JOB, and setting userdefined can be done using a cobol regsiter
RETURN-CODE i guess if we code a PGM.
Well lets see if there is a way to handle this using any utility.
Thanks,
Veera
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
No. DFSORT cannot set RC=1234.My requirement is to set the return code as 1234, is this possible through DFSORT ?
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
-
- Member
- Posts: 4
- Joined: Tue Apr 03, 2007 10:42 pm
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Well, you could write an Assembler program to call ICETOOL, have ICETOOL pass back RC=12 or RC=0 for COUNT, and then have the Assembler program pass back RC=1234 instead of RC=12. Or you could just use a program (e.g. COBOL) to check for two records and pass back RC=1234.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Raveendra,
Here is what i have done to acheive what you said,
STEP1 -> ICETOOL
COUNT FROM(INPFILE) EQUAL(2) RC4
STEP2 -> DUMMY COBOL PGM WHICH WILL EXECUTE ONLY
IF RC = 4.
NOTE : I HAVE SET 4 , YOU CAN SET 4/ 12/16 AND YOU NEED TO
BE CAREFUL AND ENSURE THAT YOU WILL NOT
GET THOSE RETURN CODES IN ANYOTHER EXCEPTION
CONIDTIONS. BEACUSE WE WANT THE NEXT STEP TO
BE EXECUTED ONLY UNDER THIS CONDITION.
I know this is not the best way but i dint find any other means too
DUMMY COBOL PGM
Thanks,
Veera.
Here is what i have done to acheive what you said,
STEP1 -> ICETOOL
COUNT FROM(INPFILE) EQUAL(2) RC4
STEP2 -> DUMMY COBOL PGM WHICH WILL EXECUTE ONLY
IF RC = 4.
NOTE : I HAVE SET 4 , YOU CAN SET 4/ 12/16 AND YOU NEED TO
BE CAREFUL AND ENSURE THAT YOU WILL NOT
GET THOSE RETURN CODES IN ANYOTHER EXCEPTION
CONIDTIONS. BEACUSE WE WANT THE NEXT STEP TO
BE EXECUTED ONLY UNDER THIS CONDITION.
I know this is not the best way but i dint find any other means too
Code: Select all
********************************************************************
STEP001 EXEC PGM=ICETOOL
********************************************************************
TOOLMSG DD SYSOUT=*
DFSMSG DD SYSOUT=*
INPFILE DD DISP=SHR,
DSN=WYOM.VEERA.C4070SD.MONTHEND.T13
TOOLIN DD *
COUNT FROM(INPFILE) EQUAL(2) RC4
*
IF RC = 4 THEN
STEP002 EXEC PGM=DUMMYCOB
*
SYSUDUMP DD SYSOUT=*
SYSPRINT DD SYSOUT=*
SYSOUT DD SYSOUT=*
ENDIF
Code: Select all
000100******************************************************************
000010 IDENTIFICATION DIVISION.
000300******************************************************************
000400 PROGRAM-ID. DUMMYCOB.
000500 AUTHOR. TEST-VEERA.
000700 DATE-WRITTEN. APRIL 13,2007.
000800 DATE-COMPILED.
000070******************************************************************
000490 ENVIRONMENT DIVISION.
007200******************************************************************
007300*
000500 CONFIGURATION SECTION.
007500*
007600 SOURCE-COMPUTER. IBM-370 WITH DEBUGGING MODE.
007700 OBJECT-COMPUTER. IBM-370.
007800*
000530 INPUT-OUTPUT SECTION.
061600*****************************************************************
061700 PROCEDURE DIVISION.
061800******************************************************************
061800 MOVE '1234' TO RETURN-CODE.
062000 STOP RUN.
062000******************************************************************
079300******************************************************************
Veera.
-
- Member
- Posts: 4
- Joined: Tue Apr 03, 2007 10:42 pm
Only to ensure that the return code is not due to an exception, i wasNOTE : I HAVE SET 4 , YOU CAN SET 4/ 12/16 AND YOU NEED TO BE CAREFUL
AND ENSURE THAT YOU WILL NOT GET THOSE RETURN CODES IN ANYOTHER EXCEPTION
CONIDTIONS. BEACUSE WE WANT THE NEXT STEP TO BE EXECUTED ONLY UNDER THIS CONDITION.
trying to set a return code of 1234. Anyways, I think a cobol program to
read the records and set the return code is the only option
Thank you Frank and Veera...
Regards,
Raveendra.
Raveendra,
Just a taught ....
If u r sure that file will never be empty , i.e file will atleast contain the hearder and trailer even if it doesnt contain any records then u can set the rc to empty file condition and then run the cobol dummy step..Well even if u code a complete cobol pgm and if the file contains records apart from the header and trailer then what r u planning to do ..have one more sort step to do the process or u can
handle the process in COBOL.
If we go with assumption that file will never be EMPTY , you can use the
above approach for sure.
Frank can give his taught on this ....
Frank in SORT when the file is empty rc will be 4 i guess ..is there a possibility that the rc could be 4 under any other conditions....please let us know.
Thanks,
Veera.
Just a taught ....
If u r sure that file will never be empty , i.e file will atleast contain the hearder and trailer even if it doesnt contain any records then u can set the rc to empty file condition and then run the cobol dummy step..Well even if u code a complete cobol pgm and if the file contains records apart from the header and trailer then what r u planning to do ..have one more sort step to do the process or u can
handle the process in COBOL.
If we go with assumption that file will never be EMPTY , you can use the
above approach for sure.
Frank can give his taught on this ....
Frank in SORT when the file is empty rc will be 4 i guess ..is there a possibility that the rc could be 4 under any other conditions....please let us know.
Thanks,
Veera.
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
DFSORT normally passes back RC=0 for an emtpy file unless you specify NULLOUT=RC4. ICETOOL can pass back RC=4 for an empty file if you use COUNT with RC4.Frank in SORT when the file is empty rc will be 4 i guess ..is there a possibility that the rc could be 4 under any other conditions....please let us know
Yes, DFSORT and ICETOOL can pass back RC=4 for other conditions. For more details, see:
http://publibz.boulder.ibm.com/cgi-bin/ ... 0721170811
and
http://publibz.boulder.ibm.com/cgi-bin/ ... 0721170811
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
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
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page