OPTIONAL Parameter Data Area

How does one make a whole PDA OPTIONAL?

PARAMETER USING 'PARATEST' OPTIONAL

The code above doesn’t work.
And how would I code the corresponding IS SPECIFIED condition?

Note that the PDA is coded as follows:

01 PARAMETERS  (1:*)
02 PARA1 (A5)
02 PARA2 (N7)
02 PARA3 (N7)

You can only make individual parameters optional, but not the entire data area.

Well, that may be a problem. Thanks, Wolfgang.

Regarding the SPECIFIED keyword, examples may be found in library SYSEXPG in FNAT. Here is a listing of FUNCEX02:

DEFINE FUNCTION F#ADDITION
  RETURNS (I2)
  DEFINE DATA PARAMETER
    1 #PARM1 (I2) OPTIONAL
    1 #PARM2 (I2) OPTIONAL
    1 #PARM3 (I2) OPTIONAL
  END-DEFINE
  /*
  RESET F#ADDITION
  IF #PARM1 SPECIFIED
    F#ADDITION := F#ADDITION + #PARM1
  END-IF
  IF #PARM2 SPECIFIED
    F#ADDITION := F#ADDITION + #PARM2
  END-IF
  IF #PARM3 SPECIFIED
    F#ADDITION := F#ADDITION + #PARM3
  END-IF
  /*
END-FUNCTION
*
END

It is not clear from your question what you are trying to accomplish.

I am guessing that you might have an existing PDA and probably have many objects that call a subprogram that uses the pda. You want to know if a calling object does or does not pass arguments. If this is a correct interpretation, you might employ code like the following

define data parameter
1 #a (a35) optional
1 redefine #a
2 #b (a10)
2 #c (n15)
2 #d (a10)
end-define
*
if #a specified
::::
end

This would only require adding a first field to the pda which encompasses all your current fields.

Hi Steve. Yes, we had to do away with the whole PDA and use OPTIONAL only on individual parameters.

We merely wanted to know if a whole PDA could be optional, which Wolfgang kindly answered.

Thanks.