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 ‘ ***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.
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) 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.