[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1196
  • Last Modified:

How to write in pogram instruction for the compiler?

Hi,
In my RPGLE program, when I compile it
with option 14 and then F4,
I change the parameter value ->ALWNULL        *Yes
How can I do to write in the body of my program
this instruction to the compiler?
thanks      
0
bobdylan75
Asked:
bobdylan75
  • 2
  • 2
  • 2
1 Solution
 
tliottaCommented:
You haven't told us what version of i5/OS nor which RPG compiler you are using. I'll assume that the compiler is RPG/400.

If the specification is required in the program source, then convert the source to RPG IV (which probably should be done anyway). In RPG IV, you can use ALWNULL(*INPUTONLY) as a H-spec option. Specifying ALWNULL(*YES) on the command gives the same result as ALWNULL(*INPUTONLY).

If you don't convert to RPG IV, you can't use anything in the program source for this without purchasing (or otherwise obtaining) a pre-processor that might modify the compile command to force ALWNULL(*YES).

I'm not directly familiar with any such pre-processor, but internet searches should locate any that might exist.

Technically, you could probably create one yourself. It might simply read your source member and generate a compile command based on comments that you place in the source; or you might use the various pre-processor APIs to enforce your standard. (But I believe the pre-processor APIs are only used for modules, so you'd need to convert to RPG IV anyway.)

Tom
0
 
bobdylan75Author Commented:
I'm using v5r3m0
I use the standard compiler for that.
With option 14 in STRPDM.
When I tell RPGLE I tell RPG IV.
RPGLE = ILE RPG = RPG IV
0
 
Gary PattersonVP Technology / Senior Consultant Commented:
In V5R3 ILE RPG, you can specify the ALWNULL() keyword on an "H" spec at the top of the program.  See the example below.

H ALWNULL(*YES)

Open in new window

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Gary PattersonVP Technology / Senior Consultant Commented:
BTW, all of the allowed H specs, along with examples are in the V5R3 ILE RPG Reference - a really handy book to review and have at hand if you plan to code RPG:

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/books/sc092508.pdf

- Gary Patterson
0
 
bobdylan75Author Commented:
Thank you Gary!
0
 
tliottaCommented:
Be careful with ALWNULL(*YES) in place of ALWNULL(*INPUTONLY). It is not documented as an allowable value in V5R3, nor up through V7R1.

Tom
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now