Saturday, January 17, 2026

How do I get the DCL variable into PCL?

17-Jan-2025


How do I get the DCL variable into PCL?

When creating scripts, you usually switch between PROMIS and VMS. You write Scripts (.scr) and command procedures (.com), and you extract data either by running PROMIS scripts or by running TP commands. And 99.9% of the time, evaluation and decision-making is at the DCL level.

When you have the set of commands and variables that you want to run in PROMIS, how do you make these available in PROMIS (PCL)?

Quite simple, actually. And you would feel it silly once you know it.

Here's how. Really simple.

Let's say in DCL, you have a variable named var:

$ var :== this_value

At this points, this is only available in DCL, and when you go up to PCL, issuing %var will result in error.

To make 'var' variable available in PCL, just prefix it with 'pcl_'. Yes, that simple.

So

$ var == this_value

becomes

$ pcl_var == this_value

and then when you issue %var in PCL, the value will be resolved.

No, you don't use %pcl_var in PCL, only %var.

So what if you want to retain var variable in DCL?

Just add a line to assign the value of var into another variable, but that variable has to have 'pcl_' prefix, like this:

$ var == this_value

$ pcl_pvar == ''var'

or, if you want string value, just add double quotation mark before and after the assignment, like so:

$ pcl_pvar == "''var'"

Then at PCL, you can use '%pvar' and the value is resolved.

Alright. That's it for now. Hope this helps.

Till then!


No comments:

Post a Comment