VSCode for IBM i and BOB now have creation parameters as variables!

Compile Time Variables make life easier.

We can define a variable in our Rules.MK File and reference that anywhere in our project.

My Power System runs IBM i V7R5M0 but I want to create my code using V7R4M0. 

I can easily define this in my rules.mk files like this:

%.MODULE: private TGTRLS := V7R4M0
%.PGM:    private TGTRLS := V7R4M0

As far as I can tell, this only work for MODULES and PROGRAMS at this time. But since Code for IBM i is constantly developing watch for new features.

Here is an example of a real rules.mk which is building 3 modules, then bound into 1 ILE program plus a related command:

VSCode for IBM i and BOB now have creation parameters as variables! 1
UPDATE APRIL 2025 COMING SOON - NOTE this feature using variables is not available yet. But it has been requested from the team of Code for IBM i Developers and apparently its being worked on. Fingers crossed!!!

Simply edit your Rules.mk file in your project root folder to define the value as a variable. This new feature let me easily my global target compile release to *PRV using a global variable.

Root Rules.MK

Here is an example where I am adding the TGTRLS parameter as a variable called PROJECT_TGTRLS

PROJECT_TGTRLS := *PRV
SUBDIRS = core database service commands
Compile Time Variables make life easier.

Now this is defined we can reference this variable anywhere else in our project workspace. 

This example I am using the variable PROJECT_TGTRLS to set the TGTRLS to *PRV for this module:

@SRV3RD.MODULE: @SRV3RD-Third_Party_Interface_Procedures.sqlrpgle
@SRV3RD.MODULE: private TGTRLS := $(PROJECT_TGTRLS)

@SRVEGGS.MODULE: @SRVEGGS-Retrieve_egg_details.rpgle
@SRVEGGS.MODULE: private TGTRLS := $(PROJECT_TGTRLS)

And I could then use the same technique for the *SRVPGM like this:

Compile Time Variables make life easier with TGTRLS
VSCode for IBM i and BOB now have creation parameters as variables! 2
{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
>