iSeries & System i

Data Attribute

%DecPos( numeric expression )

%Elem( table, array or mult-occur data struct )

%Len( expression )

%Size( variable, literal, array, table, dsn-name )

Dates

%Mseconds( number )

}

Use instead of

ADDDUR, SUBDUR

 

Newdate =

Duedate + %Days(23)

%Seconds( number )

%Minutes( number )

%Hours( number )

%Days( number )

%Months( number )

%Years( number )

 

%Date( { expression { : date-format } }) – to date

%Diff( op1 : op2 : duration code )

%Subdt( value : duration code )  (use %Trim!!)

%Time({ expression : { : time-format }})

%Timestamp({ expression : { : *ISO | *ISO0 }})

Data Conversion

%Char( expression { : date/time fmt }) – from date

                charvar = %char( Datdatatyp : *USA)

%Dec( num/char expr { : precision : dec places })

%DecH

%Editc( numeric : editcode { : cur-symbol })

%EditFlt( numeric expression )

%Editw( numeric : editword )

%Float( num/char expression )

%Graph( expression { : ccsid })

%Int( num/char expression )

%IntH( num/char expression )

%Str( basing-ptr { : max-len }) ( right-hand-side )

%Str( basing-ptr : max-len )( left-hand-side )

%UCS2( expression )

%Uns( num/char expression )

%UnsH ( num/char expression )

Files/Arrays

Built-in function

When to use

Equivalent Indicator

%Eof

Read, Readc, Reade, Readp, Readpe, Write (subfile only), Open

EQ

%Found

Chain, Delete, Setgt, Check, CheckR, Scan (but not %Scan)

GT

%Equal

Setll, Lookup

exact match

%Error

Operations with ‘E’

LT

%Status

 

INFDS *Status

 

Files/Arrays (con’t)

%Fields( name { : name… } )

%Kds( data-structure-name {: number-of-keys })

%Lookup( arg : array { : startidx { : numelems }} )

%LookupGt
%LookupGe
%LookupLt
%LookupLe

%Occur( dsn-name )

%Open( file )

%TLookup( arg : search-table { : alt-table })

%TLookupGt, %TLookupGe, %TLookupLt, %TLookupLe

%Xfoot( array-expression )

Math functions

%Abs( numeric expression )

%Div( numerator : denominator )

%Rem( numerator : denominator )

%Sqrt( numeric expression )

Pointers/Storage

%Addr( variable )

%Alloc( num )

%PAddr( string | prototype )

%Realloc( ptr : num )

Strings

%Check( comparator : base { : start } )

%CheckR( comparator : base { : start })

%Replace( replstring : srcstring { : startpos { : src

 len to replace }} )

%Scan( search arg : source string { : start })

%Subst( string : start { : length })

%Trim( string )

%TrimL( string )

%TrimR( string )

%Xlate( from : to : string { : startpos })

Miscellaneous

%Bitand( expression : expression {: expression… } )

%Bitnot( expression )

%Bitor( expression : expression {: expression … } )

%Bitxor( expression : expression )

%NullInd( fieldname )

%Parms

%Shtdn

%This

 

Thanks to Carmen Nuland, publ. at Search400.com
Back