RPG xTools Add-on Library

Partial List of the xTools' RPGLIB Service Program SubProcedure Names

The following list is not inclusive but represents the exposed subprocedures that can be called from the RPGLIB. For a list of subprocedures exported from the CGILIB click here.

Items in BLUE were added recently.

Subprocedure Name Include File Description
AskUser askuser Prompt the end-user for a reply using a pop-up window. Similar to a dialog box in Microsoft Windows.
CharToNum chartonum Converts a numeric value that is stored as text a character field or buffer into numeric. Supports stripping out editing such as currency symbol, thousands notation, and decimals.
SSTNUM chartonum Same as CharToNum except allows the caller to specify a substring start and length within the input variable.
CleanNum chartonum Filters non-numeric data from a character field, returning only the numeric value itself as a character string. It may then be passed to CharToNum to convert it into a true numeric value.
min compare Returns the lowest numeric value from a list of numeric values.
max compare Returns the highest numeric value from a list of numeric values.
InList compare Used on an IF statement, compares a single field to a list of values and return *ON ('true') if it is found on the list of values.
CvtCase convert Convert between upper and lower case (either direction). Is sensitive to the CCSID (codepage) on the machine.
ToLower convert Convert upper to lower case letters.
ToUpper convert Convert lower to upper case letters.
CvtToHex convert Converts character into their two-letter hexadecimal notation.
CvtFromHex convert Converts two-letter hexadecimal notation to their single character equivalent.
XLateCCSID convert Convert between two national language CCSID's or codepages. Also used to convert ASCII to EBCDIC or EBCDIC to ASCII.
ToASCII convert Helper function to convert from EBCDIC to ASCII.
ToEBCDIC convert Helper function to convert from ASCII to EBCDIC.
EnQuote convert Doubles embedded quotation marks within a character string for use in prompting or converting to comma separated values or EDI strings.
CPSDATA convert Compress a string of data. Useful for compressing text strings over 128 bytes in length.
DPSDATA convert Decompresses (uncompress) data.
BitToInt convert Convert a string containing only 0 and 1 into the corresponding numeric value.
IntToBit convert Converts an integer into a character string of 0 and 1 (binary notation).
CvtInitCap convert Converts the initial letter of each word of a sentence to upper case. Useful for converting fields that contain proper names to the correct upper/lower case combination.
CvtFtoC convert Convert Fahrenheit to Celsius
CvtCtoF convert Convert Celsius to Fahrenheit
CvtCtoK convert Convert Celsius to Kelvin
CvtLBtoKL convert Convert pounds to kilograms
CvtKLtoLB convert Convert kilograms to pounds
CvtUOM convert Convert one unit of measure to another. User-extendable.
CvtToCSV convert Converts a single database record to a comma separated string of values.
CpyToCSVIFS convert Copies an entire database file to a comma separated values string and stores the result in a target file on the IFS.
SetCSVProp convert Sets up conversion parameters for the CvtToCSV and CpyToCSVIFS subprocedures.
csvOpen convert Opens a file on the IFS to receive comma separate value "records".
csvWrite convert Converts a regular OS/400 database record to a comma separated "record" and writes it to the IFS.
csvWriteHdr convert Write out a record to the IFS as a traditional CSV header. That is, all field names are written to the IFS file, separated by commas and NOT enclosed in quotes.
csvClose convert Close a file opened for writing to the IFS as a CSV file.
CvtToXML convert Does a primitive conversion of a regular OS/400 database record by converting it to XML tags.
CpyToXMLIFS convert Converts an entire database file to primitive XML tags and stores the result in a target file on the IFS.
     
DayOfWeek dates Returns the day of week for the given date as 1 to 7 with Sunday=1.
GetDayEx dates Uses an RPG IV version of Zeller's conguence to calculate the day of the week. Returns the day of week for the given date as 1 to 7 with Sunday=1.
GetEndofMonth dates Returns the date of the end of any month, given a date within that month.
GetDayName dates Returns a long or short day name given a date.
GetDateString dates Allows a date to be converted into virtually any format, including character text, using user-specified formatting codes.
TimeStamp dates A helper function to convert a date into a timestamp data type.
GetWeek dates Returns the week number for a given date.
GetWeekISO dates Returns the week number for a given date in ISO standard format.
GetDayOfYear dates Returns the day of the year for a given date.
CvtDateString dates The complement of GetDateString, returns a date value from a formatted character date value.
GetDate dates Return relative date for the specified date. Caller may indicate Relationship and Day. For example:
GetDate('Next' : 'Monday') Get date for next Monday.
GetDate('Prev' : 'Wednesday') Get date for previous Wednesday.
GetDate('Third' : 'Thursday') Get date for the 3rd Thursday of the month.
GetDate('Last' : 'Workday') Get date for last work day (M-F) of the month.
GetDate('Yesterday') Get yesterday's date.
GetDate('Next' : 'Workday') Get date of next work day (M-F).
GetDayCount dates Returns a count of the number of times the specified day occurs in a given month.
     
DebugMode debug Returns *ON (true) if the program is running in debug mode.
     
FindReplace findrepl Finds and replaces text. Can search for a string of characters, or individual characters and either replace them or delete them from the target string.
     
DlyJobTM job Performs a "delay job" for the given time data-type value.
DlyJob job Performs a "delay job" for a given interval specified in seconds.
DlyJobEx job Performs a "delay job" for a given interval of days, hours, minutes and seconds.
GetJobType job Returns the type of job (interactive or batch) running the program.
     
GetLIBL libl Retrieve the current library list (any portion) for the job. The returned library names are stored in an array.
SetLIBL libl Allows you to change the existing library list by specifying the new library list as an array of library names.
AddLIBLE libl Allows you to add one or more library names to the existing library list, and optionally specify the location of that inserted library names.
RtvLIBL libl Retrieves the current library list (any portion) for the job. The returned library names are stored in a single, large return variable.
ChgLIBL libl Allows you to change the existing library list by specifying the new library list as a single, large list of library name separated by on or more blanks.
     
GetNextEntry lists Returns a "record" from a previously created list of items.
CrtFldList lists Create a list of field name for a given file.
GetFmtName lists Returns the record format name for a given database file name.
CrtMbrList lists Create a list of member names for a given file.
CrtDbrList lists Create a list of database relations (based on logicals, or physical file names) for a given file.
CrtModList lists Create a list of module names used to create a program or service program.
CrtObjList lists Create a list of OS/400 object names.
CrtHFSList lists Create a list of hierarchical file systems "mounted" on your system.
CrtSBSList lists Create a list of active subsystem names.
CrtSplList lists Create a list of spool file names for a given user or job.
CrtJobList lists Create a list of job names that are running on the system.
CrtProcList lists Create a list of subprocedure names for a given module or service program.
CrtActUsrList lists Create a list of users currently running jobs ("signed on") on the system.
CrtUsrList lists Create a list of user profile names.
CrtLockList lists Create a list of jobs that have a lock on the specified object name.
     
FACT math Returns the Factorial of the input value.
MOD math Returns the MODULO (remainder) of the input value.
LOG10 math Returns the Log, base 10 of the input value.
LOG2 math Returns the Log, base 2 of the input value.
LN math Returns the Log, base N of the input value.
SIN math Returns the Sine of the input value.
SINH math Returns the Sine Hyperbolic of the input value.
ASIN math Returns the Arch Sine of the input value.
TAN math Returns the Tangent of the input value.
TANH math Returns the Tangent Hyperbolic of the input value.
ATANH math Returns the Arch Tangent Hyperbolic of the input value.
ATANH2 math Returns the Arch Tangent Hyperbolic using two input values.
ATAN math Returns the Arch Tangent of the input value.
COS math Returns the Cosine of the input value.
ACOS math Returns the Arch Cosine of the input value.
COSH math Returns the Cosine Hyperbolic of the input value.
EXP math Returns of Exponential base e of the input value.
PWR math Returns the power of the input base value raised to the specified power. (Same as X**Y)
ROOT math Returns the specified root of the input value.
GAMMA math Returns the gamma for the input value.
GAMMALN math Returns the gamma natural log for the input value.
     
GetMsgInfo msg Returns 1st and 2nd level text for a given message ID. Including embedded message data, if specified.
GetMsgText msg Returns 1st level message test for a given message ID. Including embedded message data, if specified.
     
NumToNum numtochar Extracts a numeric value from a raw input buffer and converts it into a numeric value.
NumToZoned numtochar Extracts a numeric value from a raw input buffer and converts it into a zoned decimal return value, then returns that zoned decimal value as a character string.
NumToChar numtochar Extracts a numeric value from a raw input buffer and converts it into a character string representation of that number.
     
GetLibSize objects Return the correct space utilization (disk size) of a given library name.
     
CrtUsrSpace space Create a user space given just the user space name.
DltUsrSpace space Delete a user space.
ChgUsrSpace space Change user space data.
GetUsrSpace space Get user space data.
RtvUsrSpace space Retrieve user space data into a parameter.
RtvUsrSpaceA space Retrieve all user space attributes. Returns the current size, auto-extend attributes, and initialization character.
GetUserSpaceA space Retrieve a single user space attributes.
GetUsrSpacePtr space Retrieve a pointer to a user space.
CpyUsrSpace space Copy user space data to a second user space.
CrtUsrSpacePtr space Create a user space and return a pointer to the new user space. Used primarily when you want to use a user space as dynamic memory.
     
GetSysValue sysvalue Return any system value.
GetSysName sysvalue Return the system name.
GetCPUCount sysvalue Return the number of CPUs on the machine.
GetSrlNbr sysvalue Return the serial number of the machine.
GetPtnInfo sysvalue Return information about the partition.
     
ChkObjExists utils Checks for the existence of an object.
rtkJobLog utils Write a text string to the joblog. Substitution values are supported.
rtkTrace utils Write a text string to the job's trace log. Substitution values are supported.
rtkDebug utils Sets on debug (special joblog logging) for the RPG xTools.
rtkCgiDebug utils Sets on debug logging for CGI subprocedures only.
FmtText utils Formats a text string with substitution text.
GetModulus10 utils Returns the modulus 10 check digit for a given number.
GetModulus11 utils Returns the modulus 11 check digit for a given number.
TrimL utils Same as %TRIML built-in function except permits user-specified characters to be trimmed.
TrimR utils Same as %TRIMR built-in function exept permits user-specified characters to be trimmed.
RslvspEx utils Returns an OS/400 system pointer to a given object name.
EditCode utils Same as %EDITC except permits the edit code to be specified at runtime.
EditWord utils Same as %EDITW except permits the edit word to be specified at runtime.
GetUsrState utils Returns a count of the active jobs for the specified user profile, or zero if no user jobs are active.
GetGTINChk utils Retrieves the GTIN check digit for the given number. Up to a 40-digit number is supported.
GetGTIN8, GetGTIN12, GetGTIN13, GetGTIN14, GetGTIN17, GetGTIN18 utils Retrieves the GTIN check digit for the GTIN number of the specified size. This are helper functions that wrap GetGTINChk().
GetKeySpacePtr utils Creates a user space and initializes it for use with the "Key Value" subprocedures, then returns a pointer to the new user space. If the user space already exists just a pointer to that user space is returned.
SetKeyValue utils Creates a key value and associates some data with that key value. If the key value already exists the data is replaced.
GetKeyDataPtr utils Returns a pointer to the data associated with the key value. Also returns the length of the key value's data in parameter 2.
     
AddVLDLE vldlist Add an entry to a validation list.

[ Back to Top ]