ILE RPG procedures Proper-, Pascal- and CamelCase()

These procedure converts a string to Proper-, Pascal- and CamelCase.

The routines will handle exception for certain words like ‘ApS’ (Danish company type), ‘A/S’ (Danish company type, ‘LTD’ (UK/US company type), ‘GmbH’ (German company type) and others. You can extend with type you need. Further, words starting with ‘Mc’ or ‘Mac’ will also be converted correctly.

Continue reading

ILE RPG procedure FindFiles() to search the IFS for files, version 2

This procedure searches the IFS tree structure (including sub-directories) for files and directories having a name that matches the mask 🙂

When a matching file or directory is found, a ‘File Found’ procedure is called. The ‘File Found’ procedure is one that you supply to process the found file/directory. An example of a ‘File Found’ procedure is supplied.

Continue reading

ILE RPG procedure to convert a string to upper/lower case – fast

The two procedures described in this article, converts a string to upper or lower case. The conversion is done fast by using a combination of a translation API to provide the correct translation tables, which includes national characters for us with such, and then use the build in function %XLate to perform the actual translation very fast.

The speed of the convert is way faster than using SQL (Set B  = Upper(A) ) or translate APIs. These two methods will do the job if you just need to convert now-and-then. A batch job converting many fields/records will benefit from my fast routines.

Continue reading

ILE RPG function to search the IFS for files

An updated version of these procedures can be found here.

This function searches the IFS for files and directories having a name that matches the mask 🙂

When a matching file is found, a ‘File Found’ function/procedure is called. The ‘File Found’ function/procedure is one that you supply. An example is supplied.

Continue reading

ILE RPG function to convert a string to upper/lower case

» Please note, that this article has been superseded by this one: ILE RPG function to convert a string to upper/lower case – fast. If you convert many fields/records in one go, these procedures are way faster that doing it using SQL 😉

The two functions, contained in this module, converts a string to upper and lower case. The advantage of these two ILE RPG functions is, that the conversion includes national characters 🙂 For us Danes, the letters ‘æøåáé’ will be converted to ‘ÆØÅÁÉ’.

Continue reading