Display records in ascending order in DB2/400 physical file

1215 pts.
Tags:
DB2/400
DSPPFM
STRSQL
I have created one physical file with 1 key field. After that I added some data in that file. Records in the 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?

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Splat
    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.
    7,665 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following