Month: April 2018

%ScanR() – Scan Reverse for Characters

%SCANR returns the last position of the search argument in the source string, or 0 if it was not found. Syntax: %SCANR(search argument : source string { : start { : length } } ) %SCANR is similar to %SCAN. They differ only in the direction of the search • The “start position” represents the […]

%Max() and %Min() Built-in Functions

%Max() returns the maximum value of its operands: %Min() returns the minimum value of its operands. Example : Dcl-s Price1 Packed(7 : 2); Dcl-s Price2 Packed(7 : 2); Dcl-s Price3 Packed(7 : 2); Dcl-s Costliest Packed(7 : 2); Dcl-s Cheapest Packed(7 : 2); Costliest = %Max(Price1 : Price2 : Price3); Cheapest = %Min(Price1 : Price2 […]

What does On-Exit Opcode do?

If you want to run some cleanup code when a procedure ends like • Deallocating the allocated storage. • You want to delete a temporary file You can put that code into the ON-EXIT section of your procedure, and the code will run no matter how your procedure ends Example : dcl-proc Sampleproc; dcl-s p […]

Get the scheduled job entries using SQL

Using the DB2 for i service view QSYS2.SCHEDULED_JOB_INFO, we can get the scheduled job entries. This view returns info similar to the command WRKJOBSCDE. Select * from Qsys2.Scheduled_Job_Info Order By Scheduled_By;  

Business benefits to stay on IBM i

1. The most secure platform – ever – in terms of Security IBM i has been so far the only platform with no viruses.No real security events. It is much harder to hack  IBMi – as the entire solution is built upon each other: it is one coherent system, where each element “is aware” when […]