RPG Questions


Number of lines of code in a program
hi, I’ve 50 programs to find the number of lines of code in it… is there any smart way? Thanks, N.

Answer Question   |  September 4, 2009  9:50 PM
AS/400, RPG
asked by:
895 pts.

How to convert RPG to a .txt file
How do you take a regular source member and convert it a .txt file?

Answer Question   |  September 3, 2009  9:38 PM
RPG, RPG to .txt file
asked by:
40 pts.

SNDUSRMSG equivalent in RPG (including VALUES and DFT)
Some time ago I found a piece of code by Scott Klemens regarding the implementation of SNDUSRMSG in RPG using QMHSNDM and QMHRCVPM. I need to do the exact same thing, however I also need to pass the values for the VALUES and DFT keywords used with SNDUSRMSG. Does anybody have an idea on how [...]

Answer Question   |  April 20, 2010  1:19 PM
API, AS/400, CL, iSeries, RPG, SNDUSRMSG
asked by:
5 pts.

RPG Logic Cycle ?
HI,     How to know that a RPG program using RPG Logic Cycle or Not?     Jayanta

Answer Question   |  August 21, 2009  6:37 AM
RPG, RPG Logic Cycle, RPG logical operators
asked by:
25 pts.

Logical File without Keyfield
If i am using a logical file without key fields in RPG program , it will show any error ?   Jayanta

Answer Question   |  October 12, 2009  10:08 AM
Logical Files, RPG
asked by:
25 pts.

Serialization: Mutexes vs. Semaphores
I am looking for a way to serialize access to a RPG program across multiple jobs. I have been doing some research on mutexes and semaphores and I am wondering what the advantages/disadvantages of each are. Also if there are any other ways to accomplish this. Thanks in advance for your reply

Answer Question   |  October 12, 2009  1:22 PM
iSeries, Mutex, RPG, Semaphore
asked by:
170 pts.

Scrolling Message in RPGLE
Does anyone know how to create a scolling message on the bottom of a display screen? I am programming on the AS400 in RPGLE

Answer Question   |  August 19, 2009  9:22 PM
Display File, RPG, RPG ILE, RPG/400, RPGLE
asked by:
165 pts.

Get user id in CGI RPG program
Please, kindly advise on this issue I am having. Program is coded in RPG and is a CGI module. I tried to get user-id from program data structure, but this “UserID 254 263″, but it shows QTMHHTTP, because this pgr runs on HTTP server. How else can I obtain real user-id of the user who [...]

Answer Question   |  August 14, 2009  6:31 PM
CGI, Java, RPG, RPGLE
asked by:
115 pts.

Empty Date Type Variable
  What does a *ISO Date type variable contain if it is not populated? It is not *Zero or *Null???  

Answer Question   |  August 12, 2009  10:10 AM
RPG, RPG IV, RPG Programming
asked by:
100 pts.

RPG ILE Day of Week
Are there alternate ways to determine the day of the week. I have the following formula - DayOfWeek = %Subst((‘Sunday ‘ ‘Monday ‘ ‘Tuesday ‘ ‘Wednesday’ ‘Thursday ‘ ‘Friday ‘ ‘Saturday ‘ ):(((%Rem(%Diff(%Date():%Date(’1941-12-07′):*D):7)+1)*9))-8:9);

Answer Question   |  August 13, 2009  6:56 PM
AS/400, RPG, RPGILE
asked by:
1,245 pts.

Date Formatting in RPG
I have a date in a DATE type field in *ISO format (ccyy-mm-dd) However, I want to extract the YY portion. Using %SUBDT(field: *Y) returns CCYY. Is there a nice way of doing this without using a data structure?

Answer Question   |  August 13, 2009  10:22 AM
RPG, RPG IV, RPG Programming
asked by:
100 pts.

PGM described update file
Hi, I’m trying to update a program described file. I have tried setting the F specs up to allow processing by key by placing the following information in the noted locations: 07-14: file name 15: “U” 16: “F” 19: “F” 26-27: File length (32) 30: The length of the key (8) 31: “A” 32: “I” [...]

Answer Question   |  August 11, 2009  9:15 PM
PGM, PGM described file, RPG
asked by:
320 pts.

RPG IV Date Formatting
What is the best and cleanest way to convert a character date dd / mm / yy to *ISO format?

Answer Question   |  August 7, 2009  12:49 PM
RPG, RPG Date Formatting, RPG IV
asked by:
100 pts.

HELP — RPG 400 LOCAL DATA (LDA)
Can i usr tow lda (local data area) in one CL program that calls an RPG program? if so please help with code illustations thanx

Answer Question   |  July 31, 2009  8:54 PM
RPG, RPG/400
asked by:
5 pts.

RPG/400 – Reduce Manual Intervention
Currently when we run EOD we have to wait for the other system’s file. If the file did not arrive after some time, I will prompt message for operator to reply the message when the file is ready. How do I split my job so that we can use control M to submit the job [...]

Answer Question   |  July 31, 2009  7:33 AM
EOD process, RPG, RPG/400
asked by:
85 pts.

SQL in CLP
Hi, I have to create a command that permits a user to copy records from one file to another and then remove those records from the first file. We’ve been doing it all manually using CPYF and INCREL and then deleting the records using an SQL Delete statement. I got the idea to create a [...]

Answer Question   |  January 28, 2011  2:05 PM
RPG, SQL
asked by:
320 pts.

Remove hard coding AS/400 RPG
Hi, I have a program that will be used in different countries. Each country have different selection criteria. How do I design my program such that I do not hard code the selection criteria? Note: Selection criteria could be more than 1 fields or from more than 1 file.

Answer Question   |  August 6, 2009  6:48 AM
Hard Coding Solution - AS400 RPG, RPG
asked by:
85 pts.

Settin on LR indicator not closing files
I have a service program that ends with *INLR but it does not close the files after its procedure is called. It is compiled with ACTGRP(*CALLER) the program that uses it is also compiled with ACTGRP(*CALLER). However, if I use the CLOSE op code, the file closes. Is this natural or should this be corrected [...]

Answer Question   |  July 18, 2009  9:09 AM
*INLR, *INLR problem, LR indicator, RPG, RPG/400
asked by:
560 pts.

Default value of a Indicator data type
Hi, can you please temme, what is the default value of a Indicator data type (N) which is declared with ‘INZ’?

Answer Question   |  July 15, 2009  7:47 AM
Data Types, RPG, RPG/400
asked by:
30 pts.

RPG ILE ending program properly on an error
Hello, Could someone please help me with this? 1. I have an ever running job that calls a particular ILE program (PGM A) to do some XML parsing and composing. 2. PGM A calles another program PGM B (which in turn has modules MOD B, MOD C and a NOMAIN module MOD D binded to [...]

Answer Question   |  August 1, 2009  5:34 PM
RPG, RPG ILE, RPGILE
asked by:
55 pts.