ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

AS400/SQLCOBOLLE - PRTF - Using an indicator to change font used

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • AS400/SQLCOBOLLE - PRTF - Using an indicator to change font used

    I'm having a complete mental block! My business analyst wants one field of a document to print in reverse type in a specific situation. I created the PRTF with 2 fields. I can print reverse or not reverse, but I can't seem to switch between the two. I added an indicator to one field and turn it on and off appropriately. Please tell me, what am I missing?

    PRTF:
    STICKER1 20A -
    FNTCHRSET(QFNT18/CZB60C -
    T1V10284 (*POINTSIZE 20))
    POSITION(6.60 0.10)
    86 STICKER2 20A -
    FNTCHRSET(QFNT18/CZB600 -
    T1V10284 (*POINTSIZE 20))
    POSITION(6.60 0.10)

    COBOL:

    IF WS-Stck-value = 'XXX' OR SPACES
    MOVE WS-Stick-Text TO STICKER1
    ELSE
    MOVE WS-ON TO FG-IND(86)
    STRING FUNCTION TRIMR(WS-STICK-TEXT)
    '*********'
    DELIMITED BY SIZE INTO STICKER2.


    Thank you so much - I just need my brain jump-started, I think. Unfortunately, the only other developer here who works in AS400/COBOL is unable to help with this one!

  • #2
    I would try adding an indicator of N86 to the Sticker1 field in the DDS.

    Comment


    • #3
      First, I'd go back to using a single field instead of two fields with an indicator. And if I used an option indicator at all, I'd use it only on the FNTCHRSET() keyword itself rather than at the field level.

      Then, if that worked as desired, I'd remove the indicator usage entirely and specify FNTCHRSET() with program-to-system fields. The program would place the font-character-set, and possibly library-name, into the field(s) rather than having fixed names in the PRTF.

      At some point, I might go as far as defining a DS in a *DTAARA and having the program retrieve the name values from it. That helps to allow some external control over what the printed output looks like.
      Tom

      There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

      Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

      Comment


      • #4
        Huge apologies for the lateness of this reply. Thank you so much for the assistance. Tom, I used program-to-system fields and that worked wonderfully.

        Comment

        Working...
        X