Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : programming pearls - The fastest algorithm can frequently be replaced by one that is almost as fast and much easier to understand.

Google
 
Web mainframegurukul.com

Welcome to the mainframegurukul forums.

You are currently viewing our mainframe forums as a guest which gives you limited access to view most discussions, articles. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support at admin@mainframegurukul.com


Set Return Code using DFSORT

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
raveendra_ibm
Member


Joined: 03 Apr 2007
Posts: 4

PostPosted: Fri Apr 13, 2007 10:59 am    Post subject: Set Return Code using DFSORT Reply with quote

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.
Back to top
View user's profile Send private message

Veera
Moderator


Joined: 22 Feb 2006
Posts: 111

PostPosted: Fri Apr 13, 2007 7:51 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
raveendra_ibm
Member


Joined: 03 Apr 2007
Posts: 4

PostPosted: Fri Apr 13, 2007 7:59 pm    Post subject: Reply with quote

Hi Veera,

Thanks for your time..
Quote:
Do you just want to set the RETURN-CODE if the record count = 2

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.
Quote:
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.
Back to top
View user's profile Send private message
Veera
Moderator


Joined: 22 Feb 2006
Posts: 111

PostPosted: Fri Apr 13, 2007 8:20 pm    Post subject: Reply with quote

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.

Code:


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           



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
Back to top
View user's profile Send private message
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 487
Location: San Jose, CA

PostPosted: Fri Apr 13, 2007 9:08 pm    Post subject: Reply with quote

Quote:
My requirement is to set the return code as 1234, is this possible through DFSORT ?


No. DFSORT cannot set 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/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
raveendra_ibm
Member


Joined: 03 Apr 2007
Posts: 4

PostPosted: Fri Apr 13, 2007 9:20 pm    Post subject: Reply with quote

Thanks for your response Frank !!!

Could you suggest me any other way of achieving the same... Sad

Regards,
Raveendra.
Back to top
View user's profile Send private message
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 487
Location: San Jose, CA

PostPosted: Fri Apr 13, 2007 9:26 pm    Post subject: Reply with quote

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/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Veera
Moderator


Joined: 22 Feb 2006
Posts: 111

PostPosted: Fri Apr 13, 2007 10:48 pm    Post subject: Reply with quote

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 Smile


Code:


********************************************************************
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                                                             



DUMMY COBOL PGM

Code:


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******************************************************************




Thanks,
Veera.
Back to top
View user's profile Send private message
raveendra_ibm
Member


Joined: 03 Apr 2007
Posts: 4

PostPosted: Sat Apr 14, 2007 8:20 pm    Post subject: Reply with quote

Quote:
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.

Only to ensure that the return code is not due to an exception, i was
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 Sad

Thank you Frank and Veera...

Regards,
Raveendra.
Back to top
View user's profile Send private message
Veera
Moderator


Joined: 22 Feb 2006
Posts: 111

PostPosted: Sun Apr 15, 2007 12:47 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 487
Location: San Jose, CA

PostPosted: Sun Apr 15, 2007 8:08 pm    Post subject: Reply with quote

Quote:
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


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.

Yes, DFSORT and ICETOOL can pass back RC=4 for other conditions. For more details, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CM20/2.4.1?DT=20060721170811

and

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CM20/2.4.2?DT=20060721170811
_________________
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/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Veera
Moderator


Joined: 22 Feb 2006
Posts: 111

PostPosted: Sun Apr 15, 2007 11:18 pm    Post subject: Reply with quote

Thanks Frank ,

Ok so with ICETOOL it can be handled with EMPTY file thru COUNT and by setting the RC appropriately we can achieve the solution of setting RC = 1234 or any userdefined value with combination of ICETOOL and a DUMMY COBOL PGM.

Rest is upto Raveendra how he goes about it.

Thanks,
Veera.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts IAM BEGINNER IN JCL ...PLZ HELP ME 3 Guest 12379 Wed Jul 07, 2010 8:20 am
anilsani285 View latest post
No new posts Hi plz help me out 5 Guest 5261 Wed Jul 07, 2010 8:18 am
anilsani285 View latest post
No new posts File-Aid Help 1 Nicholas 8377 Thu Apr 13, 2006 2:12 pm
rangab View latest post
No new posts Search Batch file-aid help 6 frenchman 9142 Tue Mar 28, 2006 5:30 pm
Guest View latest post
No new posts executing java program thru JCL 1 Guest 7517 Fri Mar 17, 2006 10:14 am
arrbee View latest post
 



This widget requires Flash Player 9 or better








Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB