IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Rexx log capturing


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 141
Location: India

PostPosted: Mon Sep 25, 2023 11:39 pm
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Senior Member


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

PostPosted: Tue Sep 26, 2023 12:25 am
Reply with quote

How does your job look like? See also IKJEFT01/IKJEFT1A/IKJEFT1B variants.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2081
Location: USA

PostPosted: Tue Sep 26, 2023 12:47 am
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2081
Location: USA

PostPosted: Tue Sep 26, 2023 12:55 am
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 720
Location: Denmark

PostPosted: Tue Sep 26, 2023 2:01 am
Reply with quote

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
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 141
Location: India

PostPosted: Tue Sep 26, 2023 10:45 am
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 720
Location: Denmark

PostPosted: Tue Sep 26, 2023 12:57 pm
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 720
Location: Denmark

PostPosted: Tue Sep 26, 2023 1:05 pm
Reply with quote

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
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 141
Location: India

PostPosted: Tue Sep 26, 2023 2:12 pm
Reply with quote

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
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 141
Location: India

PostPosted: Fri Sep 29, 2023 7:02 pm
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 720
Location: Denmark

PostPosted: Fri Sep 29, 2023 7:11 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2569
Location: Silicon Valley

PostPosted: Fri Sep 29, 2023 10:56 pm
Reply with quote

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
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 141
Location: India

PostPosted: Tue Oct 03, 2023 4:34 pm
Reply with quote

Exactly Pedro,

But i haven't tried this for whole program I need to try though.

Thanks for reply
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 720
Location: Denmark

PostPosted: Tue Oct 03, 2023 5:52 pm
Reply with quote

You should, it will
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2569
Location: Silicon Valley

PostPosted: Wed Oct 04, 2023 12:45 am
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2569
Location: Silicon Valley

PostPosted: Wed Oct 04, 2023 12:51 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 alphabets in a REXX and fin... CLIST & REXX 2
No new posts Call an hlasm from REXX in batch and ... CLIST & REXX 4
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top