In the last stage of the ELSEIF, the ‘ELSE’ part is optional. Note: Instead of Nesting Ifs use an ELSEIF or a SELECT/ENDSL below. Note: The expression is evaluation and the result is placed right-adjusted in the result field.ĮVALR Name = ‘Jimmie ‘ EVALR Name = ‘Jimmie ‘ ĮVALR Name = %TRIMR(‘Jimmie ‘) EVALR Name = %TRIMR(‘Jimmie ‘
![rpgle edit word o spec rpgle edit word o spec](https://i0.wp.com/as400i.com/wp-content/uploads/2020/04/Open-File-in-SEU.png)
***After the EVAL below, the value of Chars contains ‘ab****ghijklmno’ĮVAL %SUBST(Chars:3:4) = ‘****’ %SUBST(Chars:3:4) = ’****’ Total *= Count //Short for previous exampleĮVAL Total = Total / 7 Total = Total / 7 ĮVAL(H) Interest = Rate * Amt EVAL(H) Interest = Rate * Amt //EVALused for half adjustĮVAL A = %TRIMR(‘Hi ‘) + A = %TRIMR(‘Hi ‘) + %TRIML(Chars) Total -= Count //Short for previous exampleĮVAL Total = Total * Count Total = Total * Count IF NOT %EOF(Rickfile) IF NOT %EOF(Rickfile) ĮVAL Data# = Data# + 1 Data# = Data# + 1 ĮVAL Total = A * (B – 1) Total = A * (B – 1) ĮVAL Total = Total – Count Total = Total – Count Note: In free format the EVAL operation is not required sometimes.
RPGLE EDIT WORD O SPEC FOR FREE
Note: For free format always use the actual name of the file and not the record format name.ĭOW NOT %EOF(Rickfile) DOW NOT %EOF(Rickfile)
![rpgle edit word o spec rpgle edit word o spec](http://3.bp.blogspot.com/-lAP-SI292hc/Um5BhI6BPDI/AAAAAAAAADc/nkZtab8uz5w/s400/3.jpg)
Note: In free format end a line of code with a semicolon ( ), allĬode within structures are indented, and start a free format program with /FREE Note: Some free format examples only work with V5R1 and higher. Some of the more useful opcodes follow, but not all.