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
what is the use of sflnxtchg?
can anybody help me to solve this problem. the program that i m checking display error message saying "Record format for file AJDSPFFD does not match model file and decimal error. how to solve this problem. The AJDSPFFD is snapshot the AJTLOG that is the audit trail list.
can I touch the array during treatments?
How to declare the pull button in AS/400..
What is ment by record level identifier?
how do you use commitment control in rpg?
What is difference between bind by copy and bind by reference?
if there is a module object , how to find the program object for this module object.Assume the module object name and program object name is not same.
what is the procedure and explain about real time scenario.
during execution, an rpg/400 program automatically follows a sequence of operations for each record that is processed. The built-in program cycle includes the following logical steps.
what are the key words you must use when using a subfile?
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...........
which program rpg or cl is efficent to update a transaction onto a database file and why ?
how can I tell when to replace the array?
1. If there are two programs using same file and 2 users are using the file at the same time and what can be done to allow them both to access? 2. How can remove lock from the file for accessing it by both users?