i hav 2 logical files(L1,L2) both r derived from one physical
file(P1). how can i use both the logical files in one RPG
program? if yes what i have to d.

Answers were Sorted based on User's Feedback



i hav 2 logical files(L1,L2) both r derived from one physical file(P1). how can i use both the lo..

Answer / henry

Yes you can use both L1 and L2 in teh same pgm by renaming
the record format of one of the LF (Either L1 or L2)

Is This Answer Correct ?    15 Yes 1 No

i hav 2 logical files(L1,L2) both r derived from one physical file(P1). how can i use both the lo..

Answer / sriaknth

If two logical files are using same record format, RENAME keyword should be used on F spec, also if similar fields are used we should use PREFIX keyword.

Is This Answer Correct ?    12 Yes 0 No

i hav 2 logical files(L1,L2) both r derived from one physical file(P1). how can i use both the lo..

Answer / ramrdy

hi henry, i used diffrent rec-formats in L1 &L2. but i want more clearly.

Is This Answer Correct ?    1 Yes 0 No

i hav 2 logical files(L1,L2) both r derived from one physical file(P1). how can i use both the lo..

Answer / alok.yee001

We need to rename the rocord format of atleast one logical file so that program will recognize the both files.

Prefix the fields is not really required (program will be compiled without prefix).

Is This Answer Correct ?    1 Yes 0 No

i hav 2 logical files(L1,L2) both r derived from one physical file(P1). how can i use both the lo..

Answer / ravikumar895

Hi,

copy those two logical files data into a physical file using CPYF command. Then, use that physical file in RPG program in F-spec...

CPYF FROMFILE(LIBRARY NAME/FILE NAME) TOFILE(LIBRARY NAME/FILE NAMECPY) FROMMBR(MBR NAME) TOMBR(MBR2CPY) MBROPT(*REPLACE) CRTFILE(*YES) FROMRCD(*START) INCREL((*IF field name *EQ 'R') (*AND field number *GT 99999999))

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More RPG400 Interview Questions

How to call one program from another program in RPG? please help me with the code

0 Answers   HCL,


give an eg of ACQ-(ACQUIRE),BIT OFF,BIT ON,DEALLOC,DUMP,FEOD,FORCE,MHHZO,MHLZO,MHLLZO,MLHZO,REL,RESET,TESTZ,TESTB,TESTN----GIVE SMALL EXAMPLE TO THE OPCODES...TO UNDERSTAND FUNCTIONING...........

0 Answers   CTS,


what was the robotech rpg?

0 Answers   IBM,


what is the rpg system?

0 Answers   IBM,


Can more than one subfile record be displayed on one line?

7 Answers   IBM,






Can we used ovrdbf command after the opnqry file if yes then What will be out put of your program?

4 Answers   IBM,


is this a rpg channel?

0 Answers   IBM,


Suppose we have one database file and it is used by 5 programs and in 3 program we have to add some records in datbase file s what is the impact on other program?

0 Answers  


How to index LF by relative record no (RRN)

1 Answers  


how to check on which PF , the LF is dependant ?

4 Answers   IBM,


In RPG program one file using as a PRIMARY file while running program some of the records reading twice any body know why its happening

2 Answers  


can anyone explain aboutovrOVRDBF,OPNQRYF, OVRSCOPE and OPNSCOPE?

2 Answers   TCS,


Categories