Physical File Without Key
20 pts.
0
Q:
Physical File Without Key
Hi guys, Currently i'm using RPGLE language.
If i have a Physical File that without key, How am i going to set my pointer.
I can't CHAIN,SETLL and SETGT as well. In order to use them, u need have a key. Am i rite?

Is there any idea to solve this matter?
Thanks!!!!
ASKED: Mar 23 2009  9:12 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
30 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
To add to Khadar's response below, you might want to think of using the OVRDBF with a KEYFLD parameter on a field in the PF, which you can use as a keyed PF in your RPG(LE) pgm.

PlanoFSXer

// ---------------------------------------------------------------------------

Hi,

You can define the file without a key on your F spec, which will allow you to process the file by relative record number. You can then SETLL and SETGT using record number as the key. Normally you would SETLL with 1 to get to the start of your file and read from there on.

Your other option would be to build a logical file over your physical and use the logical in your RPG.

Regards,

Martin Gilbert.




Hi,

You can use a CL-Command to point like this :--
OVRDBF FILE(File-name) TOFILE(Library/File-Name) POSITION(*star/*END/*RRN)

You can point like this way.


Regards

KHADAR.

//////////////////////////////////////////
Typically when a file is open you are at the beginning
You can use the read command to read one record at a time
and loop to process all of the records.

If you need specific records check for logical files using the command DSPDBR.
Create a logical if the number of records is large and/or you need the data is a specific sequence.
You can also process this file using SQLRPGLE.

Phil
/////////////////////////
Last Answered: Mar 26 2009  2:35 AM GMT by PlanoFSXer   30 pts.
Latest Contributors: Philpl1jb   24570 pts., Gilly400   23625 pts., Khadar   90 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

ReshmaG   410 pts.  |   Mar 25 2009  6:10AM GMT

Hi
can also use *Start with SETLL for a non-key file.

Regards
Reshma

 
0