Midrange News for the IBM i Community


Posted by: renojim
Green screen indicator issue
has no ratings.
Published: 08 Nov 2011
Revised: 23 Jan 2013 - 4083 days ago
Last viewed on: 28 Mar 2024 (6004 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Green screen indicator issue Published by: renojim on 08 Nov 2011 view comments(3)

Forgive me, I haven't worked on green screens for a very long time, and may never see one again. Wasn't very good at it when I did. Nevertheless, I want to RI a field on error in an old program. I have a field defined in DDS thusly:

 

A            CTRTYP         2Y 0I  7 10DSPATR(HI)
A N40                                         DSPATR(ND)

 

So I add a line:

A            CTRTYP         2Y 0I  7 10DSPATR(HI)
A N40                                         DSPATR(ND)
A  99                                          DSPATR(RI)

 

And on error I turn *in99 on, and GOTO (I know, I know) to right before the WRITE/EXFMT, which is just a few lines previous. And the field refuses to display at all. Verified in debug that *in40 is still on, and I can't find anything else that should impact the display of that field. Am I doing something obviously wrong? Code looks like this:

 

C     $ADRECS       BEGSR                                              
C     #redisp       TAG                                                
C   77              SETON                                        51    
C                   SETON                                        405254
C                   WRITE     FORMAT2                                  
C                   EXFMT     CONTROL1                                 
 /free                                                                 
    here I'm checking for error, which would be duplicates found, in numrecs
 /end-free                                                               
C                   if        numrecs > 0                                
C                   eval      *in99 = *on                                
C                   goto      #redisp                                    
C                   else                                                 
C                   eval      *in99 = *off                               
C                   endif                           

 

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Green screen indicator issue
Posted: 12 years 4 months 21 days 17 hours 58 minutes ago
Edited: Tue, 08 Nov, 2011 at 11:25:18 (4525 days ago)

Simple,  RI, HI and UL  = ND

You have DSPATR(RI)

You have DSPATR(HI)

and by default all input or "both" fields are DSPATR(UL)

hence, RI+HI+UL = ND  always has, always will

Use CHGINPDFT at the record-level and it will work.

Optionally, change it so that DSPATR(HI) doesn't show up when your DSPATR(RI) is being used (looks bad anyway).

Posted by: renojim
Premium member *
Comment on: Green screen indicator issue
Posted: 12 years 4 months 21 days 16 hours 52 minutes ago

Ah, thank you Mr. Cozzi.

Posted by: DaleB
Premium member *
Reading, PA
Comment on: Green screen indicator issue
Posted: 12 years 4 months 21 days 16 hours 29 minutes ago
Edited: Tue, 08 Nov, 2011 at 12:58:19 (4525 days ago)

If you have other I or B fields, you might want to do the CHGINPDFT at field level.

A            CTRTYP         2Y 0I  7 10 CHGINPDFT
A N40                                   DSPATR(ND)
A N99                                   DSPATR(HI UL)
A  99                                   DSPATR(RI)

There's another thing that looks odd here. DSPATR(ND) is conditioned; you always allow them to type in the field, but it's only hidden some of the time. Should it be DSPATR(ND PR)? If you do protect it when hidden, you may want to remove the other formatting by adding ' 40' to the conditions.