Get an instance of the specified $ command


Inputs:  Parm1 = UJP pathname
         Parm2 = Command to retrieve
         Parm3 = Command instance to retrieve (base 1)

Outputs: Parm2 = Retrieved command line (GetCommand)
         Parm2 = Retrieved command parameters (GetProperty)

Returns:  0 = success
         -2 = cannot open UJP
         -3 = cannot read UJP
         -6 = command does not start with $

This function gets the instance of the specified command from the UJP.  For GetCommand, the full command line is returned in Parm2, and for GetProperty the actual $ command is removed from the command line before it is placed in Parm2.  In both cases, the string is truncated to 255 (or MaxBuf - 1) bytes (with a normal zero terminator) if necessary, to fit in the Parm2 field size.  If the specified instance of the command is not present, an empty string is returned.

Because multiple properties may be present in a job instance UJP, from the jobtype, owner and system UJP files, you should always use a value of 1 in parm3 to retrieve the effective command (the first such command) in the file.

The value in parm2 should normally be the name of the command, with a leading $ sign.  However the $fs_template command is  an exception to this rule and should be followed by white space and then the appropriate next parameter to select a specific template command name.

For the few commands that take no parameters, the GetProperty function will return an empty string whether or not the command is present.

Do not pass a literal string as parm2.

Examples:

Get fax header command:

strcopy(parm1, "@FFJOBS\\00001234\\OWNER.UJP");

strcopy(parm2, "$fax_header");

res = JobDllEntry("GetProperty",parm1, parm2, 1);

The above command might return in parm2:  $fax_header "header test"

 

Get retry parameters for 'busy' outcome:

strcopy(parm1, "@FFJOBS\\00001234\\NO_JTYPE\\JOB12345678.UJP");

strcopy(parm2, "$retry_delays B");

res = JobDllEntry("GetProperty",parm1, parm2, 1);

The above command might return in parm2:  $retry_delays B "3 3 3"