List ILE Builtin Functions
|
Here's a REXX program that lists ILE builtin functions.
Run it with STRREXPRC. It reveals interesting things.
OS/400 V5R1
Data = ''
Get = Copies('00'x, 512)
Obj = 'QWXHTSPC QSYS '
"CALL QUSRUSAT (&Get X'00000200' SPCA0100 &Obj X'00000000')"
Do X = 1 By 512 For C2D(Substr(Get,9,4))/512
"CALL QUSRTVUS (&Obj X'"D2X(X,8)"' X'00000200' &Get)"
Data = Insert(Get, Data, X-1, 512); End X
"OVRPRTF STDOUT QSYSPRT"
Do X = 173 By 20 While X < Int(5)+1
Line = Left(Substr(Data, Int(5)+Int(X)+1, Int(X+4)), 23)
If Int(X+12) = 0 Then Do
Line = ' ' Line
Do Y = Int(9)+Int(X+16)+1 By 4 For Int(X+20)/4
Line = Line Format(Int(Y), 5); End Y
X = X + 4; End
Else Line = Format(Int(X+12), 5) Format(Int(X+16), 5) ' ' Line
Say Line; End
Return
INT: Return C2D(Substr(Data, Arg(1), 4), 4)
Thanks to Gene Gaunt
OS/400 V5R2
/********************************************************************/
/* PROGRAM - PRTBUILTIN */
/* FUNCTION - print the ILE built-in functions, V5R2-specific */
/* LANGUAGE - REXX */
/* AUTHOR - Gene Gaunt */
/********************************************************************/
"crtsavf file(qtemp/stdin)"
"savobj obj(qwxcrtmd) ",
"lib(qsys) ",
"objtype(*pgm) ",
"dev(*savf) ",
"savf(qtemp/stdin) ",
"updhst(*no) ",
"dtacpr(*no)"
"ovrdbf file(stdin) ",
"tofile(qtemp/stdin)"
"ovrprtf file(stdout) ",
"tofile(qsysprt) ",
"splfname(prtbuiltin)"
data = ''
do forever
parse linein record
if record == '' then leave
data = data || left( record, 512 )
end
walk = c2d( substr( data, X( 75 ), 3 ))
walk = c2d( substr( data, X( 1D ) + walk, 3 ))
walk = c2d( substr( data, X( 75 ) + walk, 3 ))
walk = c2d( substr( data, X( 45 ) + walk, 3 ))
walk = c2d( substr( data, X( 665 ) + walk, 3 )) + X( 0 )
name = walk + x2d( 2190 )
code = walk + x2d( 37B0 )
do while walk < name
AA = c2d( substr( data, walk, 4 ))
BB = c2d( substr( data, walk + 4, 2 ))
CC = c2d( substr( data, walk + 6, 2 ))
DD = c2d( substr( data, walk + 8, 2 ))
EE = c2d( substr( data, walk + 10, 2 ))
if BB == 0 then leave
show = left( substr( data, name + AA, BB ), 20 )
do DD while EE == 0
show = show ||,
right( c2d( substr( data, code + CC * 4, 4 )), 6 )
CC = CC + 1
end
say show
walk = walk + 12
end
return
X: return x2d( 4001 ) + x2d( arg( 1 ))
Thanks to Gene Gaunt and Dave McKenzie
OS/400 V5R3
/********************************************************************/
/* PROGRAM - PRTBUILTIN */
/* FUNCTION - print the ILE built-in functions, V5R3-specific */
/* LANGUAGE - REXX */
/* AUTHOR - Gene Gaunt */
/********************************************************************/
"crtsavf file(qtemp/stdin)"
"savobj obj(qwxcrtmd) ",
"lib(qsys) ",
"objtype(*pgm) ",
"dev(*savf) ",
"savf(qtemp/stdin) ",
"updhst(*no) ",
"dtacpr(*no)"
"ovrdbf file(stdin) ",
"tofile(qtemp/stdin)"
"ovrprtf file(stdout) ",
"tofile(qsysprt) ",
"splfname(prtbuiltin)"
data = ''
do forever
parse linein record
if record == '' then leave
data = data || left( record, 512 )
end
walk = c2d( substr( data, X( 75 ), 3 ))
walk = c2d( substr( data, X( 1D ) + walk, 3 ))
walk = c2d( substr( data, X( 75 ) + walk, 3 ))
walk = c2d( substr( data, X( 45 ) + walk, 3 ))
walk = c2d( substr( data, X( 665 ) + walk, 3 )) + X( 0 )
name = walk + x2d( 22A0 )
code = walk + x2d( 3980 )
do while walk < name
AA = c2d( substr( data, walk, 4 ))
BB = c2d( substr( data, walk + 4, 2 ))
CC = c2d( substr( data, walk + 6, 2 ))
DD = c2d( substr( data, walk + 8, 2 ))
EE = c2d( substr( data, walk + 10, 2 ))
if BB == 0 then leave
show = left( substr( data, name + AA, BB ), 20 )
do DD while EE == 0
show = show ||,
right( c2d( substr( data, code + CC * 4, 4 )), 6 )
CC = CC + 1
end
say show
walk = walk + 12
end
return
X: return x2d( 5001 ) + x2d( arg( 1 ))
Thanks to Gene Gaunt
|