Tuesday, 28 August 2012

How to program on an AS/400

The following outline details the basic steps of program development on the AS/400. 

Since there may be multiple ways to complete a task, some more appropriate than others depending on the situation, various ways of doing essentially the same thing are shown under each outline heading.

  1. Log in.
  2. Setup area for source
    1. Create a library (optional) - CRTLIB
    2. Create a source physical file (optional) - CRTSRCPF
  3. Type source into physical file member.
    1. Start source entry utility - STRSEU
    2. Work in program development manager
      • STRPDM
      • WRKLIBPDM
      • WRKOBJPDM
      • WRKMBRPDM
    3. In PDM: <F6> - create a member.
  4. Compile the source member to attain object and compiled. spool file.
    • Option 14 from the PDM lines.
    • CRT___PGM - where ___ can be CBL, PAS, C, PAS, BAS, etc....
  5. Wait for compilation to complete.
  6. Display message to see if completed successfully - DSPMSG
  7. Check spool file to see if any Fatal errors or warnings.
    1. WRKSPLF
    2. Choose option 5 - DISPLAY.
    3. Page to bottom of file.
    4. Note if there are any warnings or errors or fatal errors.
    5. If there are errors or fatal errors go to to step III and correct.
    6. If there are any warnings determine if they are important and if deemed so go to step III and correct.
  8. Check for dependencies.
    • Does program need data files - if so create or attain them.
    • Does program need other programs - if so create or attain.
  9. Execute the program.
    • CALL library/programname
    • Option 16 from a WRKOBJPDM screen.
  10. If program gives a run-time error.
    1. Move cursor to error description - hit <F1> (help)
    2. Look for error and statement number.
    3. Cross reference statement number with source line number with spool file - WRKSPLF
    4. Correct error.
    5. Go to step III.
  11. Log off.

No comments:

Post a Comment