Subfile, dynamic access, AS/400

370 pts.
Tags:
AS/400
AS/400 Subfiles
What does it mean by accessing a SUBFILE DYNAMICALLY, I understand that dynamic access can be made on physical file clearly telling that there data in the physically file can be accessed dynamically. But what does it mean by accessing subfile dynamically, please explain with a suitable example.

Software/Hardware used:
AS400, os400, cobol400,
ASKED: July 4, 2013  6:57 AM
UPDATED: July 5, 2013  12:17 PM

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: 7  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
    There are various possibilities. What is the context that you found the reference in? . Tom
    125,585 pointsBadges:
    report
  • Durgesh813
    i was learning sub-files and saw tutorial of IBM they specified, access is dynamic for sub-files. it was a basic program of display few data from PF files on the sub-files. now what i didn't get is what are we basically accessing in a sub-file. all i know is that we use sub-files to display data on the screen or get data from the screen. so what does accessing has to do in displaying job. please i am a beginner so i probably don't know much of the context or possibilities you are talking about.
    370 pointsBadges:
    report
  • TomLiotta
    A subfile is actually an in-memory file. You use the SFLSIZ keyword to tell the system how much memory to allocate initially for a subfile. We think of them as "display" files simply because that is what we almost always define them for. and, of course, they can only be defined with DSPF DDS. . The subfile itself never is part of any display. Instead, the system transfers parts of the subfile memory back and forth between the display and memory depending on how the user presses scroll keys and how your program writes subfile records. That's why you can write up to 9999 records to a subfile even though the last records will probably never show on any screen. A display screen can never hold more than 27 (or 24) records. . You don't ever have to display a subfile. You can write records to a subfile, read them back into your program, update records, delete records, and none of them ever need to be copied by the system to a display. It's only when you write a control record with "display subfile" enabled that anything will show on a display. . If the display file is SHARE(*YES), you can even pass a subfile into a different program without ever displaying any part of it. . I'm still not sure what is meant by 'dynamic'. The first thing I think of is that subfile records are accessed by record number. . Tom
    125,585 pointsBadges:
    report
  • Durgesh813
    That was a lot of help tom you cleared most of my concepts i find that you tech in the best possible way with best possible examples. thanks for the concepts although i would still like to know more about sub-file record and record numbers. what are they please brief them also. Regards Durgesh Singh
    370 pointsBadges:
    report
  • Splat
    Subfile records can be retrieved into your program using the Chain operation with a relative record number as the key as follows:
    Chain(e) Rrn_number Sfl_rcd;
    6,255 pointsBadges:
    report
  • philpl1jb

    Here is a rough description of RRN. 

    Every subfile record has a relative record number (from 0001 to 9999) when you declare the subfile record in the F spec you associate a program variable with that subfile rrn.  Before you write a record to the subfile you must set the RRN to write to.  When you use a READC to read a changed record from the subfile the program associated variable will contain that records rrn.  Display file sfl control keywords allow the return of the subfile record number or controlling if the subfile record is displayed when the screen is displayed .. and if the cursor should be positioned on the subfile record. 

    Phil

    48,575 pointsBadges:
    report
  • TomLiotta
    There isn't much to say about subfile records and record numbers. Each record is written by your program, like any record is written. And each one is read like any record. (There are some details that let you customize the I-O.) . Individual records become represented on a display screen as a line. (It's possible to define the display to have each subfile record show as two, three or more lines.) . When your program writes a record to a subfile, it must set a variable that tells the system which record number is being written. And when records are read back in, you can read specific records by record number, or you can read sequentially. . Tom
    125,585 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