RPG Writing, Compiling, and
notes on life's little problems

Writing  Compiling  Debugging  Problem Solving
iSeries Sign On problems  Other Problems
Ohmygoditsallgone


To print a spooled file: WRKSPLF , use option 2=Change , Page Down, under Additional Parameters ...
Output queue . . . . . . . . . .   PRT01         Name, *SAME, *DEV    
  Library  . . . . . . . . . . .     *LIBL       Name, *LIBL, *CURLIB

To change the spooled file to different output queue, just specify the other output queue's name (and library)


Option 3 on the Work with Objects Using PDM screen will not work for you. It copies by creating a duplicate object, for which you need security authority, which you do not have. Instead, use option 15 = Copy file 


top of page

Writing


top of page

Compiling

RPG compiler diagnostic messages look like:

 Msg id  Sv   Statement    Message text                 
*RNF7066 00        00nn00  Record-Format XXXXXXXXXX not used for input or output.        
*RNF7086 00        00nn00  RPG handles blocking for file XXXXXXXXXX. ...
*RNF7023 40                The Compiler cannot determine how the program can end. 

The first two messages messages can safely be ignored. You will see them frequently. They are warning messages with Severity (SV) 00. The last msg has a Severity of 40. This prevents a successful compile.

RNF7066: The record format name of a file is not always used in RPG programming. Often, just the file name is sufficient. RNF7086: get used to this msg. Blocking is rarely an issue. RNF7023: you forgot to EVAL *INLR = *ON


top of page

Debugging


top of page

Problem Solving

'Insanity is doing the same thing over and over again and expecting different results'- Albert Einstein

  1. Look at your class notes. It may jog your memory about a concept you thought important enough to write down. You didn't write it down? Promise yourself you will make more notes.
  2. RTFM. About half the questions I get are already answered in the textbook, on my web pages, in the lab or assignment specifications, and in my notes and examples in the course library's CHAPnnDEMO source files. If you have not read this material at least TWICE, you have not really read it. There is a 50/50 chance you can solve the problem yourself in minutes just by rereading the material.
  3. The iSeries will help if you put the cursor on the msg and press F1. When fixing compile errors, use SEU's "F *ERR" command to find errors and use F1. Use DSPJOBLOG to investigate run time errors. (A significant part of what I know about the iSeries was learned just by doing this.)
  4. leave the problem alone for a while and come back later. A good night's sleep is often the best help you can give yourself. After midnight, problems can take hours to solve. In the morning, they usually take minutes.
  5. show a colleague your problem. Another pair of eyes can often spot the problem. Even experienced programmers sometimes need someone else to look at their code. Also, explaining things out loud to someone else can often reveal the problem's cause. (Thinking too much can result in infinite loops.)
  6. when testing your logic, make one change at a time and re-test. Making too many changes at once can complicate debugging. When you are all done, re-test everything to make sure a fix did not "unfix" something else.
  7. PRINT the CURRENT COMPILE listing of your program (and screens) and bring it to me during help time with the problem code/messages highlighted. It should be commented.
  8. send me email and put the relevant spooled files in the PROBLEMS outq located in the RPG544TM Library. (Change the spool file's output queue in the same way that you change it to PRT01 to print it on paper.)

"Please tell me why my program will not compile/work" is NOT a good way to ask for help. As a professor, I do not debug students' programming problems. That is your job. My job is to help you do your job.


top of page

iSeries Sign On problems

If you have difficulty signing on, you have one of two possible problems.

PROBLEM 1:

If you can sign on and see this screen:

+-------------------------------------------------------------+
| Previous sign-on.................................. mm/dd/yy |
|                                                             |
+-------------------------------------------------------------+

you think everything is normal but then see the sign on screen or a display that looks like this:

+-------------------------------------------------------------+
| Job: QOADEV005L User: DC234Z99 Number : 123456              |
|                                                             |
| Job ended abnormally.                                       |
|                                                             |
| Display the job log for more information.                   |
|                                                             |
| Press enter to continue.                                    |
+-------------------------------------------------------------+

and when you do press Enter, the system returns you to the sign on screen. You have a problem in your user profile.

Don't worry, you can usually fix the problem yourself by signing on with overrides, then correcting your profile.

To sign on with overrides, specify the following on the sign on screen:

+--------------------------------------+
| User . . . . . . . . . your user id  |
| Password . . . . . . . your password |
| Program/procedure. . . *none         | <== override
| Menu . . . . . . . . . main          | <== override
| Current library. . . . qgpl          | <== override
+--------------------------------------+

After you have signed on, examine the spooled file containing your last job log – it will tell you what the problem was. Prompt the CHGPRF command with F4 and change your profile settings as needed. Then sign off and try to sign on again normally.

PROBLEM 2:

I still cannot sign on!

If you see this message displayed on the sign on screen:

CPF1394 User profile DCnnnxnn cannot sign on

it is because someone has disabled your profile -- probably because you have been running too many infinite loop jobs. (Better you cannot work than everyone cannot work.) Learn about using the System Request key to cancel a program that will not end. Never just close the terminal window. Please see your instructor who can reset your profile.

PROBLEM 3:

But I still cannot sign on!

The issue may be with your library. Have your instructor temporarily remove all references to your library from your profile: initial program, menu, MSGQ, OUTQ.


top of page

Other Problems


By the way, NEVER give someone else your password so they can look at your code in your library -- not even a professor. It breaks our computer use guidelines.


If any of these things happen to you:

then your profile has probably used up its maximum space allocation. Run DSPUSRPRF on your user id and check your usage.

Most of the space is likely occupied by old compile objects kept in a library called QRPLOBJ (replaced objects). The system keeps these because of the high security level we use on this iSeries. QRPLOBJ is cleaned out at each IPL but if you do a lot of compiles, your space limit may be exceeded before then. (IPL = Initial Program Load = reboot)

After this clean up operation, you should have enough space on the iSeries for the temporary work files needed by SEU, compiles, printing, and your own new programs & files.


top of page

Ohnooooooooitsallgone ... or how to back up with FTP

It happens every semester. Someone thinks they were "cleaning up" junk when they were really "cleaning out" their work.

It is a good idea to FTP your code at least once a day and have at least two different sets in rotation to save it on.

When using FTP, be sure to use ASCII transfer (not Binary or Auto)



[ ]