Position to in Single page subfile

35 pts.
Tags:
Logical Files
Physical File
Subfile
Hi I have one PF with Policy No . , Cust. Name and both fields are key fields in PF . I want to use position to for field cust name which is the second key field in PF . So is there any way to do this without creating any Logical file ??????(in single page subfile)

Answer Wiki

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

Here are the options
1. Logical file on Cust Name & Policy No? — You’ll probably have other uses for this logical?
2. SQL Select * where PolNo = :InPolNo
3. use OPNQRY to make a temp image of the file
4. Search file and only select those that qualify — this works for small files!

Phil

////////////////////////////////////////
The single page subfile takes the most code
how to handle the pageup and pagedown
– Page-up or Page-down keys are received by the rpg program as indicators
When you load a page put the key fields of the first record into arrays index 1
loop to load include one extra read to
– set the more and page down keys (if EOF)
– load the P+1 array values – this will be the first record of the second page
1. Position to the correct position
— Page-up – you can retain the keys of each page in an array – chain to the P-1 page .. unless P-1 is <= 0 then chaing to P page – Alternative you can have a readpe loop to go back through the necessary records
— Page-down – chain into the P +1 record
2. clear subfile
3. Load a page starting at that position

& If i want to add a new record then how to handle it
1. Typically a function key is provided for Add
2. It shows an add screen or subfile with blanks and zeros
3. user enters and confirms
4. record(s) are added
5. current page of subfile or page with new entry is displayed

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
  • S22
    Hi Thanks , But i have question that how to handle the pageup and pagedown & If i want to add a new record then how to handle it .
    35 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