I have a PF(ABC)with no key fields.
PF(ABC)have 2 fields (cusno and cusname).
Please let me know how can i read the cusno = 1150 directly
from PF in CL and RPG program(Without creating the LF and
without reading the complete file and then compare 1150)

Answers were Sorted based on User's Feedback



I have a PF(ABC)with no key fields. PF(ABC)have 2 fields (cusno and cusname). Please let me know ..

Answer / vijay

In CL PGM

do CPYF from file ABC to ABC qtemp with the selection
field (CUSTNO) = 1150 (value) so ABC in qtemp have only one
record with that cust no. then read this file in CL program.


In RPGLE...

you can used SQLRPGLE program and write a SQL select
statement on the on file ABC.

Is This Answer Correct ?    13 Yes 1 No

I have a PF(ABC)with no key fields. PF(ABC)have 2 fields (cusno and cusname). Please let me know ..

Answer / mayank taneja

In CL program:
Ovrdbf and opnqryf

In RPG Program:
SQLRPGLE

Is This Answer Correct ?    11 Yes 0 No

I have a PF(ABC)with no key fields. PF(ABC)have 2 fields (cusno and cusname). Please let me know ..

Answer / manan---as400 so cute

CL
This can be done by two ways :- a)ovrdbf b) opnqry

RPG

This can be done by SETLL + READE or READ and the second
requirement by COMP




Cheers

Is This Answer Correct ?    6 Yes 13 No

Post New Answer

More RPG400 Interview Questions

How do you do indexing in a physical file?

2 Answers  


this is rpg3 code W0RTN IFEQ @CN,002 what is the means @CN,002

1 Answers  


what is program status data structure?

1 Answers   IBM,


RPG/400 number of Records present in a physical file using file information data structure FPF001 IP E DISK F KINFDS INFDS1 IINFDS1 DS I *RECORD RECORD Is this coding correct sir,i have given I P E that is I- input,P-primary file,E-externally described. Primary to use RPG logic cycle,is this the correct method because we have to find number of records present using file information data structure in RPG/400 without doing any input/output operations on the file and also without using DSPFD,SQL. If the above coding is correct means,when i compile the program it gets compiled,but if i call the program it does not return anything,i need number of records,please complete the coding sir.

1 Answers   IBM,


How to change the name of physical members Dynamically?

1 Answers  






When we have a file with Duplicate records and I want to read the unique record from the file. For example a file containing Emp Name as 'Ram' and there are 3 entries of it. So how to read a unique record from File?

0 Answers  


1.Can any body share me about thease opcodes with example please.Im new for AS/400.Could u please tell me in real senario? 1.TESTN, 2.EVAL 3.EVALR, TIME, 4.MONITOR 5. ENDMON 6.ON-ERROR 7.COMMIT ROLLBACK?

1 Answers   CSC,


I have one cl program which calls two rpg programs named a & b. I am loading a run time array in Pgm A and the control comes back to cl pgm. i call pgmb and I want to read the runtime array in pgmb which was loaded in pgma. How it can be acheived. I should not use any intermediate file or dataarea to store the loaded values.

2 Answers  


Can we have a Physical file without any member ? Please let me know

12 Answers  


1)how to do date validation in rpg? 2)how to delete dUPLICATE RECORDS?

12 Answers   IBM, Opus,


what is the difference between the cpyf command crtdupobj command?

9 Answers   IBM,


Can we create 300 logical files based on a single physical file using the CRTLF command only once?.

8 Answers  


Categories