Searching for files and objects in the IFS

findfilesseuThe code examples in this article is based on the first version of the FindFiles() procedure. The FindFiles() procedure has been updated to Totally Free RPG and a bug have been fixed. You will find the source code, example and build script here.

I am working on a utility and I wanted to add the ability to search for files in the IFS. That is, I wanted my utility to search the entire or relevant parts of the tree structure (including sub-directories) seen from the IFS’s point of view. Had it just been a search for objects in the libraries, a DSPOBJD command could do the job. But my ambition was that the search should work anywhere in the IFS and, of cause, only find objects matching a name mask that I would provide. Sounds like a reasonable requirement, don’t you think?

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

It is time for Aprils Fool

Aprils FoolSo, 1st of April is coming up and it is time to make a little fun with your co-workers.

I have collected two Aprils Fool programs that you can use on your iSeries in order to make a little joke with your co-workers ๐Ÿ™‚

Select the program you want to use, and make sure that the program is being called in the users login program. If you do not use a login program, you can define one of the Aprils Fool program directly on the users profile as login program.

Continue reading

When was the last time you created a Windows batch file?

If the last time you wrote a Windows Batch file was back in the good ol’ MS-DOS or Windows 95 days, then time has come to step up and experience that Windows Command files is the new black ๐Ÿ™‚

Today Windows Command files has grown into an advanced script language having many interesting features. The tool iInstall.Cmd uses many of the new features in order to install a Savefile on your iSeries. Continue reading

What iSeries library is a CL program loaded from?

Most often when you develop a CL program, it is in order to use it as a ‘driver’ program for a RPG/ILE RPG/COBOL/C program. In order to make sure that the RPG/ILE RPG/COBOL/C program is called correctly you have to add the library containing the CL and RPG/ILE RPG program in question, or you can hard-code the library on the CALL command.

This is, however, not a flexible solution, as the CL and RPG/ILE RPG program cannot be copied to other libraries because the CL program will always call the RPG/ILE RPG program in the library hard-coded on the CALL command :-

Fortunately help is on it’s way ๐Ÿ™‚ Continue reading