Focal Point
[CLOSED] how to test the return code from a DYNAM command and avoid ABEND

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6177013196

May 17, 2019, 01:40 PM
Nancy Komm
[CLOSED] how to test the return code from a DYNAM command and avoid ABEND
My co-worker and I are trying to figure out a way to prevent a mainframe job from abending when a certain FOCUS return code is encountered. The objective is for the job to test her access to a variety of datasets. So our question is this: How does one test the return code from the DYNAM command? The &FOCERRNUM and the &RETCODE don’t seem to work. Instead, JES2 does not return the error to FOCUS to be tested, and so the job simply abends with a JCL error. We'd like to capture the error, and continue testing access to the other DSN's. Thanks in advance for any wisdom you can share!

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8
Windows, All Outputs
May 21, 2019, 02:47 PM
FP Mod Chuck
Nancy

I passed this post on to the FOCWIZARD in NY. DYNAM just points FOCUS to a dataset it doesn't actually access it. So in order to test it the user needs to actually try to run a report against the dataset once it is allocated. That said it is not clear what return codes you want to test for and what the JCL error is.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
May 21, 2019, 04:01 PM
TobyMills
Hi Nancy

I bet it's been 10 years since I actively developed on MVS. But - I have a thought for you to experiment with.

Read up on doing LISTDS from inside your Focexec.

It looks like LISTDS might be able to show you those security attributes if the database exists, and it will tell you if the dataset isn't there.

It's just a thought. If you using the Search option in FocalPoint and type in LISTDS, you'll get a few things. It might help to just experiment with it or google the subject to see if it would be of value to you.

Good luck!
Toby
LISTDS command
June 24, 2019, 05:10 PM
Edward Wolfgram
DYNAM does support &RETCODE. Try the following fex in TSO:
  
DYNAM ALLOC FILE WHOBAR DSNAME PGMEW.FEX.DATA SHR REU
-TYPE RETCODE IS &RETCODE                            
DYNAM FREE FILE WHOBAR                               
-TYPE RETCODE IS &RETCODE                            
DYNAM FREE FILE FOOBAR                               
-TYPE RETCODE IS &RETCODE                            
-EXIT  
 


> > ex test
RETCODE IS 0
RETCODE IS 0
RETCODE IS 8
> >


IBI Development