Information SystemsPage 1 of 1
Carmen Nuland10/03/18
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 ofADDDUR, 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( numericexpression )
%Editw( numeric : editword )
%Float(num/charexpression )
%Graph( expression { : ccsid })
%Int(num/charexpression )
%IntH( num/charexpression )
%Str( basing-ptr { : max-len }) ( right-hand-side )
%Str( basing-ptr : max-len )( left-hand-side )
%UCS2( expression )
%Uns( num/charexpression )
%UnsH ( num/charexpression )
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( numericexpression )
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
lentoreplace }} )
%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
\\Server\is_dept\Tips\Built-in functions.doc