1,040 pts.
 DB2/400
I have created one Physical File with 1 key field. After that i added some datas in that file. Records in file are displayed in Arrival order While Viewing the Records using DSPPFM, STRSQL Commands. As per my assumption, it should be ascending order. Why it is not displaying in Ascending order?

Software/Hardware used:
ASKED: July 3, 2009  3:51 AM
UPDATED: July 6, 2009  2:17 PM

Answer Wiki:
Display Physical File Member - Help The Display Physical File Member (DSPPFM) command displays a physical database file member. Records are shown in arrival sequence, even if the file has a keyed access path. You can page through the file, locate a particular record by record number, or specify a starting position in the record. You can also select a character or hexadecimal display of the records. I assume that SQL is reading the file in arrival sequence -default- since you have the ability to define the sort sequence. Phil Reminder: All the commands on the iSeries are fully documented. What you see on the iSeries help screens is what you will see in the manuals. ------------------------------------------------------------- Phil's right Records in DB2 are physically stored in arival sequence. The SQL access is on the arrival sequence, it will probably use the keyed index if you include the order by clause. DFU will show the records in keyed order. Another Phil
Last Wiki Answer Submitted:  July 3, 2009  12:42 pm  by  PSMurray   530 pts.
All Answer Wiki Contributors:  PSMurray   530 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

If you absolutely have to have the records in key field sequence, and you add them out of sequence, the only way I know of to rectify the situation is to execute a RGZPFM with KEYFILE(*FILE) once you’re finished with your adds.

Me, I recommend against keying physical files. Easier to create and change logicals.

 5,720 pts.