Category: <span>FAQs and Tips</span>

Q. I’m trying to replace the *ENTRY PLIST with a prototype, so I can use CALLP and free format. But I’m running into a problem with the LIKE keyword. The compiler is giving me the following error: “LIKE not allowed with specified Field-Location entries; keyword is ignored.”

Q. I have an RPG program that needs to read a large number of files and perform the same processing for each of them. I may not know the file names at compile time. Some of the files have different record lengths, and some of them even have different formats, although the critical fields correspond in each file (e.g., each file format has a field called Tranamount, Signed(13.2). How can I accomplish this requirement without having to code separate file specifications for each file?

Q. I’ve been trying to debug an ILE program that’s been running for some time. Recently, I recreated the program with full optimization to improve performance. But now the debugger doesn’t work. What am I doing wrong?

Q. I guess I’ve misinterpreted how %DEC is supposed to work. In the following example, the value in Char4 is 0250, so I was anticipating the same result as a Move operation — with my numeric result as 4 long, 3 decimal positions. But I get the error “The target for a numeric operation is too small to hold the result.”

Num43 = %Dec(Char4:4:3); 

Do you have a simple solution?