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 play {insert rpg system here}?
what is program status data structure?
what are the key words you must use when using a subfile?
what is the use of sflnxtchg?
What is difference between bind by copy and bind by reference?
can I touch the array during treatments?
what is a rpg?
what is an online rpg?
what is file information data structure?
what is the necessary keyword needed to scroll subfile records?
How to select highest score of each subject or how to select highest income of every month?
what is the rpg system?
what is the procedure and explain about real time scenario.
If my rpg program has a date field, what extra care I have to take while compiling that rpg program? If the file is keyed and I have declared the file as well as key list properly in my program. Still am getting an error message like "chain/reade operation is not allowed" what may be the case?
what is *place and *auto keyword in prtf ?plz explain