pjs.status()



Returns the most recent value set for the program or file status. The value is set whenever the status changes, typically when an error occurs or when the pjs.setError() API is used.

Return value

pjs.status() returns a status code. The list of status codes matches the codes returned by RPG's %STATUS() built-in function. You can find the list here.

Example:
pjs.define("charValue", { type: 'char', length: 10 }); pjs.define("statusValue", { type: 'integer', length: 3, decimals: 0 }); pjs.setError(false); try { pjs.testTimestamp(charValue, "date", "*iso"); } catch(err) { pjs.setError(err); } statusValue = pjs.status();



RPG Equivalent 

%STATUS()