0

I am a beginner learning RPGLE and working with subfiles. I have attached an image where the red highlighted area is designed using SFLCTL, and the blue highlighted area displays data fetched from the physical file and loaded using SFLDATA.

I am using RCBNBDR(SFLRCDNBR(Cursor)) to handle record positioning.

The issue I am facing is that the cursor initially focuses on the first record of the subfile (Option 1) in the blue highlighted area instead of the option field in the red highlighted area above. If I remove RCBNBDR, the cursor correctly points to the main option field, but I need both functionalities: RCBNBDR for handling records and the cursor initially pointing to the main option field.

How can I achieve this?

Home Page

Home Page

1 Answer 1

1

Use DSPATR(PC) in the DDS source for the options field in your red area.

DSPATR(PC) means "place cursor", and can optionally be conditioned with indicators. Together with an appropriate RTNCSRLOC definition in the record format for the red area, you can place the cursor e. g. into the field it was before the user pressed enter.

See my GitHub project for examples, especially v_lodpag*. I'm using the described facility to place the cursor to the position-to field initially, and when the user presses the "home" key, to quickly jump from the subfile to the pos-to field.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.