How can we write an AS/400 subfile program without using any indicators?

5 pts.
Tags:
AS/400 Subfiles
RPG indicators
RPGLE
How can we write a subfile program without using any indicators(Even no indicators for SFLDSP, SFLDSPCTL)?

Answer Wiki

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

you cannot. you must have the Subfile Display and Subfile Clear conditioned by indicators.

if you just dont like having indicators inside your program while reading it, you can do this:

<pre> *=====================================================================
* Global Variables
*=====================================================================
d SubFilDsp c Const(*In99)
d SubFilClr c Const(*In98) </pre>

in this fashion you turn on/off the SubFilDsp and SubFilClr.

-Sarge

Discuss This Question: 5  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
    You can write subfiles that don't use indicators simply by not using them in ways that require indicators. For example, SFLEND requires an option indicator, but SFLEND is not a required keyword -- simply don't use it. That means that there won't be any way for a user to tell if more records are available except by getting a device error when attempting to scroll past the end, but users commonly do that anyway. You shouldn't use SFLCLR without an option indicator because it will clear the subfile every time you write the control record. But you don't have to clear a subfile in order to use it. Just don't use the subfile in a way that needs clearing. I have subfiles that are never cleared because I never need to use them twice in the same CALL. SFLDSP and SFLDSPCTL don't require option indicators. You would only use indicators if you wanted to display the control record without displaying the subfile at the same time or if you wanted to execute a control function without displaying control or subfiles on the screen. As long as you structure things so that both control and subfile always display when you write the control format, neither of the keywords need option indicators. In short, you don't need to use indicators. You use indicators when you want the specific types of control that you decide to include. There are a couple things that you can do with indicators that can't be done any other way through subfiles. Indicators can make those things easy to do. Tom
    125,585 pointsBadges:
    report
  • Joeyski
    A DSPSIZ(24 80 *DS3) A PRINT(*LIBL/QSYSPRT) A INDARA A R WINCT SFLCTL(WINSF) A*%%TS SD 20100310 095610 KOZLOWSJ REL-V5R4M0 5722-WDS A SFLSIZ(0011) A SFLPAG(0011) A WINDOW(WIN001) A N34 ROLLUP A KEEP A SFLCSRRRN(&S1CSRRRN) A OVERLAY A N32 SFLDSP A N31 SFLDSPCTL A 31 SFLCLR RPG Program FVaa0585 Cf e WorkStn InfDs(VaaInfDs) F IndDs(VaaIndDs) D VaaIndDs Ds D SflClr n Overlay(VaaIndDs:31) D SflDsp n Overlay(VaaIndDs:32) D SflEnd n Overlay(VaaIndDs:34) D SflNxtChg n Overlay(VaaIndDs:88) A 34 SFLEND(*MORE)
    55 pointsBadges:
    report
  • TomLiotta
    Rudedog and Joeyski wrote about how to avoid using conditioning indicators and *INxx indicator references in the program. The latest example brought to mind another way not to use "indicators" in the "subfile program" -- write the program in C or COBOL. Neither language has to use "indicators" in the program code itself. Tom
    125,585 pointsBadges:
    report
  • MurrayInfoSys
    The only REAL way to program a SFL w/o indicators is to use 5250 Data Stream API's IMHO Phil (the other Phil)
    940 pointsBadges:
    report
  • Lwin
    Those of us who loved using MOVEA to turn on or off the Subfile keywords here is an example of what I do with like results. DDS Example A 91 SFLDSPCTL A 92 SFLDSP A SFLPAG(10) A SFLSIZ(11) A WINDOW(6 36 11 33 *NOMSGLIN) A 93 SFLCLR A 94 SFLDLT A 95 SFLINZ A N96 SFLEND(*MORE) RPGLE example FMIC240F CF E WORKSTN INFDS(MIC240DS) F INDDS(MIC240INDDS) F SFILE(LISTSTR:STRLRRN) * DMic240IndDS DS D SFLDSPCTL N Overlay(Mic240IndDS:91) Inz(*Off) D SFLDSP N Overlay(Mic240IndDS:92) Inz(*Off) D SFLCLR N Overlay(Mic240IndDS:93) Inz(*Off) D SFLDLT N Overlay(Mic240IndDS:94) Inz(*Off) D SFLINZ N Overlay(Mic240IndDS:95) Inz(*Off) D SFLEND N Overlay(Mic240IndDS:96) Inz(*Off) ** ** To Delete subfile C Eval %SubSt(Mic240IndDS:91:6) = '000100' ** C Write ListStrC ** C Eval %SubSt(Mic240IndDS:91:6) = '000000' ** ** To Display both the control record and subfile C Eval %SubSt(Mic240IndDS:91:6) = '110000' C Eval SRNNBR = 1 ** C Exfmt ListStrC ** For any of those of you that are interested here is another alternative to using the INDARA from the screen in an RPG program. Elwin (L'win)
    10 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