View previous topic :: View next topic
|
Author |
Message |
Digvijay Singh
Active User
Joined: 20 Apr 2022 Posts: 148 Location: India
|
|
|
|
Hi Team,
I have a rexx program which does some validation of input file and do the processing, when I am executing it my rexx gets abended due to any reason but my job or jcl which is getting submitted is still giving me max cc 00, i want my jcl should also fail when my rexx gets abend.
What I have tried:
I manually tested the rexx and wherever possible I made changes to set the rc manually and hardcode but I need a way where my jcl return code takes the return code of calling rexx. Please let me know if it is possible if yes your hint would be appreciated.
i went through this post didn't get much info:
ibmmainframes.com/about19971.html
Please help me here, this will solve my whole team of fresher in rexx unit.
Thanks in advance. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
How does your job look like? See also IKJEFT01/IKJEFT1A/IKJEFT1B variants. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2127 Location: USA
|
|
|
|
Digvijay Singh wrote: |
Hi Team,
I have a rexx program which does some validation of input file and do the processing, when I am executing it my rexx gets abended due to any reason but my job or jcl which is getting submitted is still giving me max cc 00, i want my jcl should also fail when my rexx gets abend.
|
If your REXX code has really ABENDED (not something else), then there is no chance your JCL in full not to abend.
Maybe, you are using wrong terminology?
Please: all REAL SAMPLES OF CODE AND/OR MESSAGES, - bring it here! Otherwise it's all dummy blah-blah-blah. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2127 Location: USA
|
|
|
|
Digvijay Singh wrote: |
I manually tested the rexx and wherever possible I made changes to set the rc manually and hardcode but I need a way where my jcl return code takes the return code of calling rexx. Please let me know if it is possible if yes your hint would be appreciated. |
"Program Return Code" and "Program Abend" are two different issues.
Please, make sure what you are talking about? |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 730 Location: Denmark
|
|
|
|
If you are running it in a batch job, then you should use pgmname IKJEFT1B, as IKJEFT01 will always set rc 0.
The other post that you mention is for when you run the pgm under ISPF, and it misses the point that you must exit ISPF with rc 4, in order for the ZISPFRC variable to be used. |
|
Back to top |
|
|
Digvijay Singh
Active User
Joined: 20 Apr 2022 Posts: 148 Location: India
|
|
|
|
Let me explain the issue with code,
Calling step in jcl:
Code: |
000022 //**********************************************************************
000023 //* EXECUTING REXX PROGRAM
000024 //**********************************************************************
000025 //MFBASE EXEC PGM=IKJEFT01,
000026 // PARM='ISPSTART CMD(%TIMSBMA)'
000027 //SYSPROC DD DSN=ALT0.DATA.TIR.REXX,DISP=SHR |
Rexx is failing with some error:
Code: |
603 +++ Call Process_One_Entry
325 +++ x = Process_Panel_Entries()
35 +++ call process_panel
IRX0043I Error running TIMSBMA, line 863: Routine not found
ISPD117
The initially invoked CLIST ended with a return code = 20043
SYS23269.T005357.RA000.AFAMFBSE.R0360535 was preallocated (no free was done)
READY
END |
What i am looking for if my rexx fails due to any above situation my step should also fail but it is not happing right now.The job and step are finishing with Maxcc=0000 |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 730 Location: Denmark
|
|
|
|
Interesting, the error is caught by ISPF so you never get to set the ZISPRC value. You can however catch the error yourself by using the SIGNAL ON SYNTAX command, like so:
JCL sample, note the pgmname
Code: |
//*
//TEST EXEC PGM=IKJEFT1B,PARM='ISPSTART CMD(%TEST001)'
//SYSEXEC DD DISP=SHR,DSN=LIB.EXEC
//SYSTSPRT DD SYSOUT=*
//ISPMLIB DD DISP=SHR,DSN=ISP.SISPMENU
//ISPPLIB DD DISP=SHR,DSN=ISP.SISPPENU
//ISPSLIB DD DISP=SHR,DSN=ISP.SISPSENU
//ISPTLIB DD DISP=SHR,DSN=ISP.SISPTENU
//ISPPROF DD UNIT=SYSDA,SPACE=(TRK,(1,1,1)),DCB=(ISP.SISPMENU)
//ISPLOG DD SYSOUT=*,RECFM=VA,LRECL=125,BLKSIZE=129
//SYSTSIN DD DUMMY |
REXX pgm, note the 'signal on syntax'
Code: |
/* TEST001 - TEST RC FOR FAILED PGM REXX */
say time() 'Progrm start'
signal on syntax name BadCall
Call ProcedureDoesNotExist
signal off syntax
say time() 'Progrm end'
exit 0
BadCall:
say time() 'Program failed'
zispfrc=8
address ispexec "vput zispfrc shared"
exit 4 |
This will set rc=8 for the step. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 730 Location: Denmark
|
|
|
|
Ok the error intercept should probably be something like this, for better diagnostics:
Code: |
BadCall:
signal off syntax
say '*Syntax raised for line' sigl':' Errortext(rc)
say strip(Sourceline(sigl),'t')
zispfrc=8
address ispexec "vput zispfrc shared"
exit 4 |
|
|
Back to top |
|
|
Digvijay Singh
Active User
Joined: 20 Apr 2022 Posts: 148 Location: India
|
|
|
|
Thanks for your help here let me go and try this.
Will update the forum with correct solution if it is working for me. |
|
Back to top |
|
|
Digvijay Singh
Active User
Joined: 20 Apr 2022 Posts: 148 Location: India
|
|
|
|
Thanks everyone for help.
I tried above method and its working for me, it just i had to keep this check in every possible condition where failure can occur.
Thanks Everyone once again for your help. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 730 Location: Denmark
|
|
|
|
Or perhaps setting a variable with some relevant text just before the call and then showing that variable in the 'BadCall' procedure?
Anyway, glad that it works for you. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2590 Location: Silicon Valley
|
|
|
|
Quote: |
keep this check in every possible condition |
It is not clear what check you refer to.
I think all that is needed is a single SIGNAL statement at the start of the program and to paste in Willy's BADCALL routine at the end of your program. It should handle any syntax problem anywhere in your program.
Code: |
signal on syntax name BadCall |
|
|
Back to top |
|
|
Digvijay Singh
Active User
Joined: 20 Apr 2022 Posts: 148 Location: India
|
|
|
|
Exactly Pedro,
But i haven't tried this for whole program I need to try though.
Thanks for reply |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 730 Location: Denmark
|
|
|
|
You should, it will |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2590 Location: Silicon Valley
|
|
|
|
Quote: |
all that is needed is a single SIGNAL statement |
FYI. Your post was about a syntax error so the responses focused on that, but rexx supports other types of error signals. You may want to add a few other SIGNAL statements at the beginning of the program:
Code: |
signal on error name BadCall
signal on failure name BadCall
signal on halt name BadCall
signal on novalue name BadCall
signal on syntax name BadCall
|
And maybe tweak the BADCALL routine to SAY a more general message. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2590 Location: Silicon Valley
|
|
|
|
Quote: |
to paste in Willy's BADCALL routine at the end of your program |
Be sure to have an EXIT or RETURN as the statement before BADCALL, otherwise the program may flow through to the end and execute BADCALL without a problem being encountered. |
|
Back to top |
|
|
|