RPGLE Questions


Outfile printing
In CL, I’ve created a outfile out of dspobjd cmd. To this file, i’ve filtered a column using opnqryf. I’ve copied the output (cpyqryf) to a new file. While doing this, i’m getting the error data option was not allowed with open option’ The log shows :The first file is created-> added to library. Seqonly [...]

Answer Question   |  October 16, 2012  7:14 AM
CL, cpyqryf, OPNQRYF, RPG, RPGLE
asked by:
270 pts.

Converting amount in character field to numeric in rpgle
Hi, How to convert the amount value in character field(Eg: ‘ 5,000- ‘) to numeric in rpgle. I used %DEC built in function, it shows decimal data error. Is there any bulit in function or opcode to convert ‘ 5,000- ‘ to numeric field in rpgle ?

Answer Question   |  October 8, 2012  11:04 AM
RPGLE
asked by:
270 pts.

Read the data from PF between dates
I want to read the all the record from the pf which are between some dates Eg: A PF has one year data let say 2011 year data, I want to read all the records from that pf which are from 01/03/2011 to 05/06/2011 dates. the PF fields are DATE,NAME,ADDRESS,P_no. Can anyone help me how [...]

Answer Question   |  August 22, 2012  1:06 PM
AS/400, AS/400 programming, DB2/400, RPGLE
asked by:
160 pts.

Processing scanned data that is delimited by ASCII code 029
Data that is provided by a vendor is to be scanned and processed, however instead of a fixed format, this data is “group separator” (ASCII Code 029) delimited. In the 5250 session screen field that the scanner writes to, the data is being loaded but the group separators are being stripped out. So it is [...]

Answer Question   |  August 10, 2012  5:07 PM
5250 emulator, ASCII 029, Barcode, RPGLE, scan
asked by:
7,205 pts.

Subfile
Hi i have started learning Subfile and i’ve written a Load All Subfile code to display all the records in a PF. it is working fine.But I want to know what else should i include in this code to make it accoring to coding standard. Also i need help in writing the single page Subfile [...]

Answer Question   |  July 27, 2012  12:19 PM
AS/400, RPGLE
asked by:
120 pts.

need help on getting day of the week for given date
I am using the below sql to get the day of week but i am getting :NumWeekDay as 0 I am using V5R3…can some help me on this to get the day of week. C/Exec SQL Set :NumWeekDay = DayOfWeek_ISO(:MyDate) C/End-Exec the above sql to get the day of week

Answer Question   |  July 27, 2012  10:17 AM
RPGLE
asked by:
SOW
110 pts.

File Issue (Declared in OUTPUT mode)
Hi All, A file (say FIL1) has been declared in outmode in a program A which is running continuously without ending and also writes the record in the file FIL1. There is an other program B which checks the record availablity in the file FIL1. But the problem is the problem A writes the record [...]

Answer Question   |  July 25, 2012  11:04 PM
RPGLE
asked by:
360 pts.

Need a RPGLE program
Hi, I want a RPGLE program which generate the next date. the input date format is YYYYMMDD…for eg. if we give today’s ship date it would generate the tomorrow’s ship date…it should exclude the weekend dates…I need it very urgent. Please help… simply i can say if we give today’s date as input program and [...]

Answer Question   |  July 25, 2012  8:20 AM
RPGLE
asked by:
SOW
110 pts.

Update duplicate record in rpgle
I have a file where in filed1, field2 and field3 are key fields. Now these key fields are not unique, I need to update field 4, 5 and 6 based on the selection by user via subfile. To say f1 f2 f3 f4 f5 f6 A0123 A0123A *FILE CLM/D07 D07 1 A0123 A0123A *FILE CLM/D08 [...]

Answer Question   |  July 23, 2012  11:41 AM
duplicate record, RPGLE, Update
asked by:
55 pts.

How to find the If – Endif relationship
Hi it is very hard to find which END is related to which IF statement. I know we can find it during compilation by using ”Source listing indentation ” but for this we have to check the spool file. i wanna know is there any way to find it in source. I mean i have [...]

Answer Question   |  July 2, 2012  11:52 AM
AS 400, RPGLE
asked by:
120 pts.

Identifier is ambiguous .
Hi I have a simple program that moves value ’a’ into a variable AB. the length of AB is 1. during debug I eval the value of AB.Instead of showing the value of AB it gives me the following notification : ”””” Identifier is ambiguous ””””. But when i am changing the variable name from [...]

Answer Question   |  July 2, 2012  11:02 AM
AS 400, RPGLE
asked by:
120 pts.

Month names between 2 numeric Cymd format dates
hi, Hi, I have 2 Numeric field which has cymd date format Date1     7s 0 Date2      7s 0 date1  = 1110128    ( which is 2011-01-28    : January) date2 = 1120101  (which is 2012-01-01   ;January) So what i need is , I need to write records in a file , what are all the  months inbetween these [...]

Answer Question   |  June 24, 2012  2:28 PM
AS/400, RPGLE
asked by:
510 pts.

asked by:
245 pts.

RPGLE opcode similar to SNDF in CL
Is there any way we can display a message “Processing” while the program is building the data in a subfile. In CL we can use the SNDF command to send such message to the display. Please help.

Answer Question   |  June 1, 2012  10:43 AM
CL, RPGLE, SNDF
asked by:
35 pts.

Remove extra spaces from a graphic or UCS2 field in RPGLE
I am working on a requirement where I have to trim Graphic (‘G’) or UCS2 (‘C’) field in RPG program. %TRIMR is not working for these fields. A Graphic or UCS2 field is declared with a length of 15000. However, it only contains 258 character (graphic/ucs2 type). But, using TRIMR does not remove the remaining [...]

Answer Question   |  May 19, 2012  9:52 AM
AS/400, RPGLE
asked by:
130 pts.

Parameter value in uppercase
Hi i have a problem in entry program ,when i get parameter value its convert to upercase Ex.  i have enter Inv after go to program it become INV

Answer Question   |  April 26, 2012  11:03 AM
RPGLE, RPGLE Program
asked by:
1,240 pts.

retrieve library list
how to retrieve library list when i pressed f4 in a field and is field has *all the it fetch all library listed in subfile

Answer Question   |  April 17, 2012  11:45 AM
RPGLE, Subfile
asked by:
1,240 pts.

Commitment Control in RPGLE Program
Hi, Is there any way that we can handle commitment control in RPGLE program i.e. if program dumps at some point then we rollback the updates done on other files in previous steps. Actually I am calling rpgle program from outside iSeries. If any error occurs on external interface then I have the way to [...]

Answer Question   |  April 5, 2012  3:25 PM
AS400 RPGLE, RPGLE
asked by:
120 pts.

Hidden field in single page subfile?
hi ,  When we open subfile source by using 2 or 5 option then hidden fiedl defination is like that? WWRRN       R   H        REFFLD(…….. like that………) there is no any position means defined at record format level. but when I’m tryung to find out that hidden field by uasing 17 option, I can’t find it.   [...]

Answer Question   |  March 17, 2012  6:08 AM
AS400 RPGLE, RPGLE
asked by:
130 pts.

Navigation from one sheet to another in AS400(RPGLE)
 I have converted two physical files into one flat file.Afterthat I have converted that flat file to CSV file and got two physical files data in one excel file.        But I need to write first phsical files data in sheet1 and second physical file data in sheet2 in same excel file.Is there any way [...]

Answer Question   |  February 27, 2012  3:16 PM
CL, RPGLE
asked by:
70 pts.