RPG400 Sample Program

Tags:
RPG
RPGLE
Hi, I am learning RPG/400 on my own. I am looking for a sample program which will be reading a database file and showing the records on a display file and update the records through display file. I would appreciate if anyone can provide me the same. Thanks & regrads, Rajsekhar
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

SEE THIS CODE
WHERE
&PERIODO COULD BE YOUR SCREEN VAR
&SELECT IS THE SQL STATMENT
THE CALL AT THE END IS A RPG PROGRAM WHICH SWEEP THE RESULT FILE.
********************************************************
PGM PARM (&PERIODO)
DCL VAR(&PERIODO) TYPE(*CHAR) LEN(6)
DCL VAR(&SELECT) TYPE(*CHAR) LEN(100)

CHGVAR VAR(&SELECT) VALUE( +
‘MTPERN *EQ ‘ || ‘”‘ || &PERIODO || +
‘”‘)
OPNQRYF FILE((WCLMTL18)) QRYSLT(&SELECT) +
KEYFLD((MTDLRN) (MTWCLM))

CALL PGM(SGNWSJPR)
***********************************************************
SORRY BY MY BAD ENGLISH.

============================================================

Since none of the above is RPG/400, I’m not sure what good it is. I can provide examples, but I need to have an answer to my question first. Do you want examples of RPG/400 or do you want examples of the more modern RPG IV? RPG/400 is RPG III.

Most programmers now would be far more interested in RPG IV, including how it be used as ILE RPG. RPG/400 can be pretty ugly by comparison.

Tom

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Bobbyb8
    There are a lot of RPG code examples on the internet. Try doing a google search. One of the sites is code400.com. They may have an example that will help.
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: