Move values from subfile screen to display file

285 pts.
Tags:
AS/400
AS/400 Subfiles
I have one display file and subfile. I used load all subfile to load my records in subfile, in that i have one selection filed. My question is if i give "1" in that selection field without pressing "enter" it has to be move values from subfile screen to display file? 

Software/Hardware used:
as400

Answer Wiki

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

With an interactive session on the AS400, the Enter key must be used to initiate the next action to be taken. So, if you put a ’1′ in a Subfile Select field nothing will happen until you depress the ENTER key.
Now if you are asking how to get data from a subfile screen to a different format on the display, that is a different question..
If you have the same field names in the record format as you do in the single record format, when you do a READC to read the subfile record than the data in the display will populate properly.
Usually when you have a subfile, you do not have all the data elements in the subfile that you want to display on the single record screen. All you need to do is tio put those fields in the subfile amd make them HIDDEN fields by using H as the use code.
If you field names in the database file are the same as what in used in the DSPF, you may want to the the PREFIX keywork on the F specs.

HTH, if you need more, just let us know.

Discuss This Question: 3  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
  • Splat
    Your note that "move values from subfile screen to display file" doesn't quite scan - a subfile is part of a display file, not something separate. Clarification would help. You could use CHECK(ER) on the selection field to force an Enter. Keep in mind that any value, including blank (x'40') entered in that field will trigger an Enter.
    7,215 pointsBadges:
    report
  • TomLiotta
    if i give "1" in that selection field without pressing "enter" it has to be move values from subfile screen to display file? Nothing will be done with the fields from a subfile record unless your program reads the subfile record. Your program has to know when it should read. You tell it when to read by pressing <Enter>. Splat mentions an alternative -- CHECK(ER). That can cause an automatic <Enter> whenever you type something into the field and you type the last character in the field. If the subfile field is only one character wide, then you will type the last character in the field as soon as you type the "1". Your program can then get control and read the subfile. CharlieBrowne mentions that the fields in your subfile record may have the same names as the fields in other formats in your display file. If they have the same names, then they are actually the same fields. They reference the same memory. After your program reads the subfile record, it has to write the format that you want to display. The values in those fields will be on the display screen after the write happens. If the fields don't have the same names, your program must move the values from the subfile record to the other display record. It has to do that after it reads the subfile but before it writes the other format. When you read the subfile, you should only read "changed records". That's what the READC instruction is for. As Splat said, any change at all will cause a subfile record to change. Your program needs to check to be sure that the "1" is in the subfile field. If it isn't, then you shouldn't write the other display format. Also, what will you do if two subfile records have a "1"? No matter what, none of it is going to happen automatically. You have to write all of it. Tom
    125,585 pointsBadges:
    report
  • shyedajmal
    Tom i will select the first subfile record..
    285 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