On 2/6/2019 12:34 PM, Burrows, Thomas 1001 wrote:
How do you turn this into a Free format statement?
D @Process s n inz('0')
The example I find online shows this.
Dcl-s @Process num inz(0) LIKE(LIMIT);
Not sure what LIMIT is????
And this line.
D dsPgms EsDS EXTNAME(SYSAPGPF) PREFIX(Gv)
You could do this:
dcl-s @Process ind inz(*off);
In the example you found, @Process would be defined the same as (LIKE) a
previously defined variable called LIMIT. If you define a variable LIKE
another, typically you don't define the data type. The new variable will
have the same data type as the one that it is LIKE. However, using LIKE
will not copy the initialization to the new variable.
In your second example line, the specification is defining an externally
described program status data structure that will have the same
field/column layout as the file or table SYSAPGPF. The PREFIX keyword says
to use prefix 'GV' before each subfield of the data structure. 'EsDS':
the 'E' says the data structure is externally described; the 'S' (case is
irrelevant) says it is a program status data structure; 'DS' indicates it
is a data structure; and the EXTNAME keywords specifies the name of a
physical file or table that, presumably, has the fields of a program status
DS predefined. The equivalent free format code would be:
dcl-ds dsPgms extname('SYSAPGPF') psds prefix(gv) end-ds;