3

I'd need to know how to find that a program was compiled with ALWNULL(*USRCTL) (or whatever which one).

Command DSPPGM doesn't seem to give that info.

We're running V7r1.

Thank you.

1
  • 1
    It's not in Retrieve Module Information (QBNRMODI) API which is the most logical place for it to be. I suspect it may not be available. Why do you need it, perhaps there's a different solution.
    – Charles
    Apr 1, 2015 at 20:23

3 Answers 3

4

There's no way to tell from a program (or from a module) what ALWNULL parameter it was compiled with.

2
  • I continued looking over the web after asking here, and ask some actual and ancient colleagues, everyone say they don't know or it's impossible, so you'll probably right. But why can't we know about that particuliar h-spec, when I can see, using DSPPGM, the Copyright (example), which is also from the H-Spec ? Do you have any idea? Apr 2, 2015 at 15:22
  • 1
    The reason the COPYRIGHT keyword exists is so that DSPPGM will show the copyright. All the ILE compilers have a way of adding a copyright to a module or program. There are a few other keywords that are visible by displaying the module or program, such as ACTGRP, BNDDIR, STGMDL. But most of the H spec keywords are RPG specific, and they only affect how the compiler operates. Apr 7, 2015 at 19:42
2

Revealing why the question is being asked, might allow for a response that better addresses the real needs; i.e. except for having encountered an error, there is unlikely to be any need\desire to know how the program was compiled. If the impetus for making the inquiry was an unexpected error condition, then perhaps a more appropriate question might be directed there instead.?
While not a visible attribute, manifest via neither a Display (DSP) feature nor a Retrieve (RTV) feature, the setting can be inferred from the run-time effects for the Open of a database file member by the RPG program. The indication of whether the RPG run-time had intended to open the member using the Allow-Nulls capability would be revealed in the Open Data Path (ODP) created for that Open; of course if the compiler was told to effect ALWNULL(*USRCTL), but the run-time failed to do so, that likely would be a defect and the inference would be inconclusive. FWiW the RPG DUMP feature will manifest that value as the "Null Capable Field File" attribute\setting in the "OPEN FEEDBACK" for the ODP of actual file.mbr that was opened.
Perhaps more can be gleaned from my replies here:
http://archive.midrange.com/rpg400-l/201504/msg00020.html
http://archive.midrange.com/rpg400-l/201504/msg00022.html

1
  • What happened here is that we compiled a program A with ALWNULL(*USRCTL). This program was called from a CL which created a share on a file the program A was using. A called program B, which was already on production server, with no ALWNULL specified (thus, ALWNULL(*NO) ). That made the sequence crashed, because their open path wasn't the same, but they were supposed to use the same file. Apr 21, 2015 at 12:39
1

I'm not sure what the purpose is, however you could try this approach if the object's source is on your system. The object may tell you (depending on how the object is compiled) where the source is, so you could write a program to get that meta information from the object, and then have the program open up that source member and look for the presence of ALWNULL.

If you don't have the source, and again depending on how the object was compiled, maybe you can extract the source listing from the object itself and inspect that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.