WORKUNIT

WORKUNIT

WORKUNIT( named [, type ] )

namedA string constant containing the NAMED option scalar value to return.
typeOptional. The value type of the named scalar value result to return.
Return:WORKUNIT returns a single value.

The WORKUNIT function returns values stored in the workunit. Given no parameters, it returns the unique workunit identifier (WUID) for the currently executing workunit, otherwise it returns the NAMED option result from the OUTPUT or DISTRIBUTION action.

Example:

wuid := WORKUNIT; //get WUID
namesRecord := RECORD
  STRING20 surname;
  STRING10 forename;
  INTEGER2 age;
END;
namesTable := DATASET([{'Halligan','Kevin',31},
                       {'Halligan','Liz',30},
                       {'Salter','Abi',10},
                       {'X','Z',42}], namesRecord);
OUTPUT(wuid);
DISTRIBUTION(namesTable, surname, forename,NAMED('Stats'));
WORKUNIT('Stats',STRING);

See Also: #WORKUNIT, OUTPUT, DISTRIBUTION