...
getRecord will have the same functionality as the CHAIN operation code in RPG. You may also use 'file.chain()' with the same parameters as this method.
Parameters
- Array of keys or key variable. Get the next record by key. If the file has no keys, it will default to the RRN.
- Boolean noLock. If true, no lock will be created. False by default.
- String recordName. Record format name.
- (Optional) Data structure. If a DS is passed in, the received buffer from the file will be placed into the specified DS.
...
- message - The IBM i message text.
- error - The message id.
- help - The message help text.
Examples
Code Block | ||
---|---|---|
| ||
pjs.defineTable("productsp", { read: true, keyed: true, levelIds: [ '4AFA8C636F188' ] }); pjs.define("data", { type: 'char', length: 50, varying: true }); //Find a record by the key. productsp.getRecord([101]); //If the record has been found.. if (productsp.found()) { data = pjs.char(prid); } |