Suppose you have 3 members in a database file. How to read
records from all the members
Without using CL (OVRDBF) i.e. it should be handled
exclusively in an RPG program?




Answers were Sorted based on User's Feedback



Suppose you have 3 members in a database file. How to read records from all the members With..

Answer / reecha

Using EXTMBR(member name) in the keyword option in the F
specs. For eg.

F filename I F E EXTMBR(mbrname)
This will open the particular member of the file.

Is This Answer Correct ?    19 Yes 1 No

Suppose you have 3 members in a database file. How to read records from all the members With..

Answer / shruti tayal

In F-spec use EXTMBR keyword, specify *ALL in quotes as the
parameter value, this will cause all members of the file to
get processed.

Is This Answer Correct ?    18 Yes 0 No

Suppose you have 3 members in a database file. How to read records from all the members With..

Answer / sumit gupta

if you want to read a particular member/or all member
records in RPG program without OVRDBF in CL program. Then,
you can use EXTMBR keyword.

Declare a file in f specs and in keyword option write
1) EXTMBR(*ALL)
or
2) EXTMBR(MEMBER NAME)

Member Name must be in CAPS as if you dont put it in CAPS
then severity 30 error comes while compilation.

Is This Answer Correct ?    4 Yes 1 No




Suppose you have 3 members in a database file. How to read records from all the members With..

Answer / vivek

USING MEMBER MAPPING IN LF THEN THIS LF USE IN RPG PROGRAM.
LET SEE,
PF@1 CONTAIN 3 MEMBER LIKE M1,M2,M3 AND FIELDS OF
NAME AND ID
LF@1
R R1 PFILE(PF@1)
K NAME
AFTER THAT LF USE IN RPG PROGRAM. TRy now.

Is This Answer Correct ?    0 Yes 0 No

Suppose you have 3 members in a database file. How to read records from all the members With..

Answer / reena

Create a logical file which contains the 3 members. Later
user the LF in RPG Program

Is This Answer Correct ?    1 Yes 2 No

Suppose you have 3 members in a database file. How to read records from all the members With..

Answer / syam

Create diff. 3 RUNQRY with 3 members and save it. Run this
QRY inside the RPG Program thru using EXEC CL Cammand.

Is This Answer Correct ?    4 Yes 11 No

Post New Answer



More IBM AS400 AllOther Interview Questions

What is the default access path of a file?

0 Answers  


can we retrieve dspf source?

2 Answers  


what is a non-join logical file?

1 Answers   IBM,


What is a library list ?

1 Answers  


what is a query can be run in which mode?

0 Answers   IBM,






when should I use method get, and when should I use method post in my cgis?

0 Answers   IBM,


how will you find a string using pdm?

0 Answers   IBM,


what is term cua , saa?

1 Answers   IBM,


what is the favicon.ico request that my site receives now and then?

0 Answers   IBM,


can you explain the difference between spacea,spaceb,skipa and skipb. I'm new to learning about as400 and printer files. can any one give me an example using source code showing the difference that occurs between using these 4 keywords. A-Physical file PF004 source UNIQUE R RR STUNAM 10 ROLLNU 5 0 MARKS 3 0 SEX 6 K ROLLNU 4 records present in PF004 are STUNAM ROLLNU MARKS SEX KAVYA 12,344 55 FEMALE MADHAVAN 14,579 60 MALE RAMYA 14,785 70 FEMALE KRISHNAN 14,988 72 MALE B-Printer File PRINT1 source A R HEADER A 10 3'STUNAM' A 10 20'ROLLNU' A 10 30'MARKS' A 10 40'SEX' A R DETAIL A SPACEB(1) A STUNAM 10 3 A ROLLNU 5 0 20 A MARKS 3 0 30 A SEX 6 40 A R FOOTER A SPACEB(1) A 20'END OF REPORT' C-RPG/400 Program PRTTPG source FPF004 I F E DISK FPRINT1 O E PRINTER C WRITE HEADER C READ PF004 60 C *IN60 DOWEQ *OFF C WRITE DETAIL C READ PF004 60 C ENDDO C WRITE FOOTER C SETON LR D-spooled file result set Display Spooled File File . . . . . : PRINT1 Page/Line 1/10 Control . . . . . Columns 1 - 130 Find . . . . . . *...+....1....+....2....+....3....+....4....+....5....+.... 6....+....7....+....8....+....9....+....0....+....1....+.... 2....+....3 STUNAM ROLLNU MARKS SEX KAVYA 12344 055 FEMALE MADHAVAN 14579 060 MALE RAMYA 14785 070 FEMALE KRISHNAN 14988 072 MALE END OF REPORT Bottom F3=Exit F12=Cancel F19=Left F20=Right F24=More keys I have changed from SPACEB to SPACEA now in my printer file source E-Changed PRINT1 Source A R HEADER A 10 3'STUNAM' A 10 20'ROLLNU' A 10 30'MARKS' A 10 40'SEX' A R DETAIL A SPACEA(1) A STUNAM 10 3 A ROLLNU 5 0 20 A MARKS 3 0 30 A SEX 6 40 A R FOOTER A SPACEA(1) A 20'END OF REPORT' F-Spooled file Result Set after keyword change Display Spooled File File . . . . . : PRINT1 Page/Line 1/10 Control . . . . . Columns 1 - 130 Find . . . . . . *...+....1....+....2....+....3....+....4....+....5....+.... 6....+....7....+....8....+....9....+....0....+....1....+.... 2....+....3 KAVYAM 12344U 055KS FEMALE MADHAVAN 14579 060 MALE RAMYA 14785 070 FEMALE KRISHNAN 14988 072 MALE END OF REPORT Bottom F3=Exit F12=Cancel F19=Left F20=Right F24=More keys Overprinting not displayed.

0 Answers   Tieto,


what are the important factors in error message subfile ?

0 Answers   IBM,


how can you execute a command from within an rpg program without calling a clp program?

1 Answers   IBM,






Categories