View Full Version : Parameter definitions
01-01-1995, 02:00 AM
Is there any way of looking at a compiled program object to find out what the parameters are i.e. size, type etc. Thanks in advance
06-26-2000, 06:22 AM
I think I did this once by crashing the program and looking at the dump. The taking a best guess. If it is a compile program from a package you can probably follow the the naming conventions and figuring it out.
06-26-2000, 09:58 AM
It's not as simple as DSPPGM, but, if the program still has observability (i.e. if you can convert the object from CISC to RISC), then the parameter layout in both OPM and ILE objects can be retrieved in a program.
06-26-2000, 10:40 AM
Assuming that you need to retrieve parameter definitions for an OPM program, here is how is done. 1. DMPOBJ OBJ(pgm_name) OBJTYPE(*PGM) 2. Display report produced by DMPOBJ and search for ?*ENTRY? Each field in the format (field_name.P) is a parameter of the *ENTRY PLIST of the program. Here is how to determine the definition of each parameter. 1. Call the program without passing any parameters. CALL pgm_name 2. Obviously, the program will fail, but it will return the statement number which cause the error. 3. Start a debug session. STRDBG PGM(pgm_name) 4. ADDBKP STMT(statement_in_error) PGMVAR((field_name ()) (field_name ())) 5. Now, call the program as it is invoke normally. 6. As the program reaches its break point, the parameters contents and definitions will be displayed. HTH
06-26-2000, 10:44 AM
Ahh yes that sounds like what we did... I think we toyed with the dump thing but it didn't work out.
06-27-2000, 01:27 AM
Hi Gene, How do you do it? Best regards, Carsten Flensburg
06-27-2000, 06:59 AM
Thanks so far folks. I can understand the manual dump methodology but how would it be done via a program though ?
06-27-2000, 12:55 PM
Now the questions have moved from "is it possible?" to "how is it possible?" I wrote a Display Parameter Information utility in RPGLE that runs over observable OPM/ILE programs and service programs. It does not work on non-observable objects. I will try to find a suitable locale to publish it for you along with a little Chautauqua on how the innards work. (Frankly, I am reluctant to post the code into the mosh pit of discussion forums anymore.)
07-17-2000, 01:21 AM
Thanks, Gene, looking forward to seeing that...
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.