Here’s a class I created to allow FTP from within PeopleSoft. Use it at your own risk:

I was creating a PeopleCode script to populate test persons in my database. I needed the persons to have IDs that would be padded with 0s where necessary. For example:

1. Determine how many people you are creating (eg. 100).
2. Find the number of digits of that number (eg. 100 has 3 digits)
3. Subtract that from the number of the person that you’re currently trying to create an id for (eg. 50 has 2 digits, so 3 – 2 = 1). This will give you the number of zeroes you’ll need to left pad for the id.
4. Encapsulate this number in the PeopleCode Rept function to pad the 0s:

[sourcecode language=”peoplecode”]
Local number &maxIDsToCreate = 100;
Local number &currentIDNumber = 50;
Local string &currentID = "JM" | Rept("0", (Len(String(&maxIDsToCreate)) – Len(String(&currentIDNumber)))) | &currentIDNumber;

I had a series of files with the following names:


One silly assumption that I made was that the FindFiles PeopleCode function returned a sorted array of strings. While this seemed to be the case on Windows environments, it was not the case on UNIX systems. Fortunately all I had to do was sort the array in ascending order after the call to FindFiles: