Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8450439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:58:08+00:00 2026-06-10T10:58:08+00:00

I am making a display file with a single selection list created by a

  • 0

I am making a display file with a single selection list created by a single page subfile. With this implementation I found two problems.

The first one is that when I pressed Enter to select an option for the first time when the display file had been loaded, the READC operation in the RPGLE would return the correct value (it returns the character string in the subfile record). When I pressed Enter again with a different option selected, the value from the previous Enter press was returned. In subsequent turns it kept returning the value of the selection just before it. I added a second READC after the first one in the program just to see what would happen, and found out that both READC returned values. The first one returned the value from the previous selection, the second returned the value I had currently selected.

The second problem is that selecting the same option for multiple times did not work, i.e. it only worked for the first time and if I tried to select it again immediately it did not respond.

I had applied the same logic to another single selection list made of load all subfile and it did not have any of these problems. Does it mean that single page subfile is not suitable for making single selection list?

Here is the DDS for the subfile:

A                R ITFMAT02
A                  S1OPTN          50 A 6 11
A                R ITFMAT01
A                                           SFLCLT(ITFMAT02)
A 27                                        SFLDSP
A 28                                        SFLCLR
A 29                                        SFLEND
A                                           CF12(12)
A                                           SFLSNGCHC(*AUTOSLT)

Here is the RPGLE main loop:

C        *IN12     DOWEQ       *OFF
C                  EXFMT       ITFMAT01
C        *IN12     IFEQ        *ON
C                  LEAVE
C                  ENDIF
C                  READC       ITFMAT02
C                  MOVEL       S0OPTN         W1OPTN
                     .
                     .
                     .
C                  ENDDO                     
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:58:10+00:00Added an answer on June 10, 2026 at 10:58 am

    Here is a working example. I suspect you haven’t been clearing the choice control field.

     A*
     A          R ITFMAT02                  SFL
     A            CTL            1Y 0H      SFLCHCCTL
     A            S1OPTN        50A     6 11
     A*
     A          R ITFMAT01
     A                                      SFLCTL(ITFMAT02)
     A  27                                  SFLDSP
     A N28                                  SFLDSPCTL
     A  28                                  SFLCLR
     A  29                                  SFLEND
     A                                      SFLSIZ(15)
     A                                      SFLPAG(05)
     A                                      CF12(12)
     A                                      SFLSNGCHC(*AUTOSLT)
     A            SFLRRN         4S 0H      SFLRCDNBR(CURSOR)
     A                                  1 30'Title'
     A            CHOICE         4S 0   3  1
     A                                  4  5'Choose one'
    

    And the RPG. I don’t normally work in fixed format but tried to mirror the existing style.

     fsotest    cf   e             workstn
     f                                     SFILE(itfmat02:RRN)
    
     c* clear sfl
     c                   z-add     1             sflrrn
     c                   setoff                                       272829
     c                   seton                                        28
     c                   write     itfmat01
     c                   setoff                                       28
     c* load sfl
     c     1             do        9             rrn               4 0
     c                   movel     rrn           s1optn
     c                   write     itfmat02
     c                   seton                                        27
     c                   enddo
    
     C     *IN12         DOWEQ     *OFF
     C                   EXFMT     ITFMAT01
    
     C     *IN12         IFEQ      *ON
     C                   LEAVE
     C                   ENDIF
    
     C                   READC     ITFMAT02                               80
     C  n80              do
     C                   movel     rrn           choice
     C                   z-add     0             ctl
     C                   update    itfmat02
     C                   enddo
     C                   ENDDO
    
     c                   seton                                        lr
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I´m making a simple website to display information from XML file that is created
I'm making a LIST container with my own item renderer to display xml file.
I'm making a basic file browser and wish to display the icon of each
I'm trying to implement this method of making a nice form upload: www.kavoir.com/2009/02/styling-file-upload-select-input-control-input-typefile.html/ which
I'm trying to write a mini file browser, where I display a list of
Iam making a simple app, I display pdf file with some text and images
Im making a multi activity application and the first two activities i made have
I have some data in db,now i m making them to display in the
I'm making a tool to dynamically display the sourcecode of running java class. I
I'm making a very simple application to display the contents of a database table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.