AS/400 COBOL

350 pts.
Tags:
AS/400
AS400 physical file
COBOL/400
one physical file have 6 key fields,now i want to retrive the 10th record

based on one key field,how to retrive in cobol/400 with without using logical file

ex:- emp pf have 6 key fields,and emp have records,now i want to retrive particular record in emp(10 th record only),in my cobol pgm some times use 6 key fields and some time i want use only one key field with out using logical files

pls give replay with small example



Software/Hardware used:
software

Answer Wiki

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

Discuss This Question: 2  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
  • TomLiotta
    If you only want to use a physical file (a 'table') and you program cannot know ahead of time which fields will be used as selection (key) fields out of six possible ones, there are three general possibilities.
    1. Use dynamic SQL. Specify a WHERE clause that provides whatever selection criteria is supplied.
    2. Read each each record and use IF-tests to see when records match.
    3. Use OPNQRYF to create a dynamic access path each time.
    In each case, count the records until you reach 10. (With SQL you might use relative positioning.) I suppose it's also possible to use the C library functions such as _Rlocate() — Position a Record to retrieve specific records, but it's not clear how you would use those when no appropriate access path existed (without creating one which seems to violate a "no LFs" rule.) Tom
    125,585 pointsBadges:
    report
  • abhisheka1
    Read Sequentially using counter . hardly few lines code, 
    385 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