DB2/400 basics

895 pts.
Tags:
AS/400 DB2
AS/400 Records
DB2/400
INFDS
How will I find out total number of records in a DB file without causing any I/O operation? 
Also
How will I detect the existence of a record in a DB file without causing any I/O operation? 
I think I can use INFDS and the field *RECORD but not sure how this works.
Thanks,
Nutan


Software/Hardware used:
DB2/400

Answer Wiki

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

Hi Nutan,

For the second part of your question are you looking for the existence of a specific record on a file?

If so then you can use SETLL and %EQUAL to check for the existence of the record without doing any input

e.g.

<pre>
SETLL (keyflda : keyfldb : keyfldc) FILEA;
IF %Equal(FILEA);
…….record exists…………
ELSE;
…….record does not exist…………
ENDIF;
</pre>

Discuss This Question: 4  Replies

 
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
  • philpl1jb
    Nutan Right you are, INFDS contains the count of records when the file is open. But it's not in the *RECORD location, that's the record name, useful in multi-format logical files and/or display files. You will find it in positions 156-159 it's a Binary number with 0 deccimals D MYINFDS DS D MyCntOfRec 156 159 B 0 And Narked is right on .. Setll and %Equals. Phil
    50,465 pointsBadges:
    report
  • Nutangujar
    thanks a ton both of you...
    895 pointsBadges:
    report
  • Edwardson
    Great answer, I was also seeking the same DB file matter. But much important DB for HIPAA Complaint Email
    0 pointsBadges:
    report
  • philpl1jb
    What?
    50,465 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