Profound.js Reserved Words
All of the reserved words in this section are deprecated. They only ever return the current system date, not the job or session date. Use pjs.getCurrentJobDate() or pjs.getCurrentJobDateNumeric() instead (see the individual pages below for the recommended replacement for each reserved word).
Description
Profound.js provides a set of reserved words that mirror the date-related reserved words available in RPG (*DATE, *DAY, *MONTH, *YEAR, UDATE, UDAY, UMONTH, and UYEAR). They can be referenced directly by name inside a Profound.js module, just like a field defined with pjs.define().
Because an asterisk (*) is not valid in a JavaScript identifier, the RPG reserved words that begin with * are written with a leading underscore (_) in Profound.js.
For example: RPG
*DATEbecomes_datein Profound.js, while RPGUDATEstaysudate.
Reserved Words
Reserved Word | RPG Equivalent | Returns | Recommended Replacement |
|---|---|---|---|
| Current system date as an 8-digit number ( |
| |
| Current system date as a 6-digit number ( |
| |
| Current system day of the month (1-31). |
| |
| Current system day of the month (1-31). |
| |
| Current system month (1-12). |
| |
| Current system month (1-12). |
| |
| Current system year as a 4-digit number. |
| |
| Current system year as a 2-digit number. |
|
Job Date vs. System Date
In RPG there are two different dates:
Job date - Returned by
*DATE,UDATE, and the related*DAY/UDAY,*MONTH/UMONTH, and*YEAR/UYEARreserved words. The job date can differ from the system date (for example, afterCHGJOB DATE(...)), and it does not change when a job runs past midnight.System date - Returned by the
%DATE()built-in function. It does change when a job runs past midnight.
The Profound.js reserved words listed above were originally documented as returning the job date; however, they have only ever returned the system date. The pjs.getCurrentJobDate() and pjs.getCurrentJobDateNumeric() APIs were added to return the true job or session date, and should be used in place of these reserved words.