how we retrieve records without using key field (ex:name)
from Physical File through RPG in as/400?
Answer Posted / syam
Yes, You can retrieve records from External Physical File
with key.
1.Specify PF as a program described file in RPG Program.
FFilNam IF F 80 6AIDISK KEYLOC(7)
(80=Record Lenght, 6=Key Lenght, (7)=Key starting
position)
2. IFilNam KD 01 1 C0 2 C1
I 7 12 NAME
(KD=Sequence,01=Record Id,1&2=Starting position,C=Any
Character,0=Value. Means In my file each record is having 1
and 2 posion = 01 to identify record, 7 to 12 =Name)
3.C MOVE 'SYAM' NAME
C 'SYAM' CHAIN FilNam
C N41 MOVEL NAME CUSNME
C 41 MOVEL *BLANK CUSNME
Try this code.
| Is This Answer Correct ? | 4 Yes | 10 No |
Post New Answer View All Answers
how do I declare a table or array in rpg iv?
can any one help in hawkeye and turnover or any change management system plzzzzz or send the documents to my mail id :gvsp.as4@gmail.com
How to write record if no field or the field are different in physical file in rpgle ?
How to create a login screen using a command instead of display file.... intention is to get a password field on a command..... how do you achieve this...
How to define data area in RPG program? In which scenario multi occurrence DS is use in AS400?
how do I play {insert rpg system here}?
How to declare the pull button in AS/400..
What is the difference between iter and do?
what is an online rpg?
how does the rpg element work?
What is ment by record level identifier?
What is a record lock error?
How many program bind in one module....
How do u design a physical file, when you have 2 Unique fields like for eg in A student file student ID and student examination no both are unique
What is difference between bind by copy and bind by reference?