ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Printer file control indicators not working after conversion from O specs

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

  • Printer file control indicators not working after conversion from O specs

    Good afternoon, I converted a simple report program and now have a printer file to work with. There are 2 different headings this report can have, controlled by the incoming parm that sets off an indicator. No matter what I do, the indicators are not telling which line to print, so they are printing on each other.

    Here is my printer file, the issue is under the H01 record format
    :
    *************** Beginning of data *******************************************
    A*%%********************************************** **********************
    A*%%TS RD 20160518 140931 SHARTEST REL-V7R1M0 5770-WDS
    A*%%FI+1066010000000000000000000000000000000000000 0000000000000
    A*%%FI 0000000000000000000000000000000000000000000000000
    A*%%********************************************** **********************
    A R H
    A*%%********************************************** **********************
    A*%%RI 00000
    A*%%FS 003
    A*%%********************************************** **********************
    A SPACEB(003)
    A SPACEA(001)
    A 1
    A 'REPORT NO: PR3156'
    A 20
    A '('
    A
    A MCOCDE 3 21
    A 24
    A ')'
    A CONAME 40 27
    A 77
    A 'DATE:'
    A 83
    A DATE
    A EDTCDE(Y)
    A*%%********************************************** *************************
    A*%%SS
    A*%%CL 001
    A*%%********************************************** *************************
    A R H01
    A*%%********************************************** *************************
    A*%%RI 00000
    A*%%********************************************** *************************
    A SPACEA(001)
    A 1
    A 'PAY#'
    A RPTPAY 2 0O +1
    A EDTCDE(Z)
    A 78 27
    A 'LIST OF SALARIED'
    A 78 44
    A 'EMPLOYEES'
    A 77 27
    A 'LIST OF HOURLY'
    A 77 42
    A 'EMPLOYEES'

    A 77
    A 'TIME:'
    A UTIME 6 0 83
    A EDTWRD(' : : ')
    A*%%********************************************** *************************
    A*%%SS
    A*%%CL 001
    A*%%********************************************** *************************
    A R H02
    A*%%********************************************** *************************
    A*%%RI 00000
    A*%%********************************************** *************************
    A SPACEA(003)
    A 27
    A 'FOR PERIOD ENDING'
    A LPERDT 6 0O +1
    A EDTCDE(Y)
    A 81
    A 'PAGE:'
    A 87
    A PAGNBR
    A EDTCDE(Z)
    A*%%********************************************** ************************
    A*%%SS
    A*%%CL 003
    A*%%********************************************** ************************
    A R H03
    A*%%********************************************** ************************
    A*%%RI 00000
    A*%%********************************************** ************************
    A SPACEA(001)
    A 2
    A 'PORT#/DIV'
    A 13
    A 'NAME'
    A 48
    A 'REG'
    A 60
    A 'OT'
    A*%%********************************************** *************************
    A*%%SS
    A*%%CL 001
    A*%%********************************************** *************************
    A R H04
    A*%%********************************************** *************************
    A*%%RI 00000
    A*%%********************************************** *************************
    A SPACEA(001)
    A 2
    A '========='
    A 13
    A '===='
    A 48
    A '==='
    A 60
    A '=='
    A*%%********************************************** ************************
    A*%%SS
    A*%%CL 001
    A*%%********************************************** ************************
    A R DETL
    A*%%********************************************** ************************
    A*%%RI 00000
    A*%%********************************************** ************************
    A SPACEA(001)
    A PORT1 5 0 3
    A EDTCDE(4)
    A
    A DIVSN1 1 9
    A NAME1 30 13
    A 45
    A ' '
    A UNDERLINE
    A +2
    A ' '
    A UNDERLINE
    A*%%********************************************** *************************
    A*%%SS
    A*%%CL 001
    A*%%********************************************** *************************
    A R EMPCNT
    A*%%********************************************** *************************
    A*%%RI 00000
    A*%%FS 001
    A*%%********************************************** *************************
    A SPACEB(002)
    A 24
    A 'EMPLOYEE COUNT:'
    A TOTCNT 4 0O 40
    A*%%********************************************** *************************
    A*%%SS
    A*%%CP+999CRTPRTF
    A*%%CP+ FILE(SHARTEST/PR3156PRT)
    A*%%CP+ DEVTYPE(*SCS)
    A*%%CP PAGESIZE(*N 132 *N )
    A*%%********************************************** ************************
    ****************** End of data ************************************************

    My code is doing this:

    C TIME UTIME
    *
    C LPAYTP IFEQ 'H'
    C MOVE '1' *IN77
    C ELSE
    C MOVE '1' *IN78
    C END
    *

    Any insight would be great. Thank you.

  • #2
    Do you have 77 and 78 being turned on somewhere else so that they are both on? Also why are you writing in rpg III in 2016?
    Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

    Comment


    • #3
      You could condition the headings on one indicator instead of two.

      AN77 27
      A 'LIST OF SALARIED'
      AN77 44
      A 'EMPLOYEES'
      A 77 27
      A 'LIST OF HOURLY'
      A 77 42
      A 'EMPLOYEES'


      C Eval *IN77 = (LPAYTP = 'H')

      Comment


      • #4
        Also, put the headings on the same DDS line as the indicator:

        Code:
             A N77                                27'LIST OF SALARIED EMPLOYEES'                 
             A  77                                27'[COLOR=#333333][FONT=aliceregular][SIZE=13px]LIST OF HOURLY EMPLOYEES[/SIZE][/FONT][/COLOR]'

        Comment


        • #5
          Hello all, I am working with old code here at this new job. I did what Brian suggested with this printer file and got it all going. I am taking over for someone who it retiring and knows old stuff, so everything I touch I am trying to upgrade as I go. When she is gone, I will do bigger groups of upgrades.

          Thanks for all the input.

          Comment

          Working...
          X