× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello Brad,

 

Please find the display file and sample source code used to test your
requirement alone.

 

Points to be taken care of:

      Check if INDARA keyword is put in your display file

            Use "indicators are indicator-area" statement in your write
and read statements.

            The above sample code is tested assuming max value for the
field as 1000.

            The reverse image indicator for the field CHGLSC of display
is 54.

 

 

Display file

 

A*%%TS  SD  20050430  193239  NIKIPR      REL-V5R1M0  5722-WDS

     A*%%EC

     A                                      DSPSIZ(24 80 *DS3)

     A                                      INDARA

     A          R TESTRCD

     A*%%TS  SD  20050430  193239  NIKIPR      REL-V5R1M0  5722-WDS

     A                                      CF03(03)

     A                                 12 19'NUMBER       :'

     A            CHGLSC         6Y 0B 12 36EDTCDE(1)

     A  54                                  DSPATR(RI)

     A  54                                  DSPATR(PC)

     A N53                             22 13'UNDER              '

     A                                      COLOR(RED)

     A  53                             22 13'OVER               '

     A                                      COLOR(RED)

 

Source code in COBOL

 

IDENTIFICATION DIVISION.

       PROGRAM-ID       . TESTPROGRAM.

       AUTHOR           . MUTHU.

       DATE-WRITTEN     . APRIL 30, 2005.

       DATE-COMPILED    .

      *

       ENVIRONMENT DIVISION.

       SOURCE-COMPUTER . IBM-AS400.

       OBJECT-COMPUTER . IBM-AS400.

      *

       INPUT-OUTPUT SECTION.

       FILE-CONTROL.

            SELECT TESTFILE

                   ASSIGN TO WORKSTATION-TESTDSPF-SI

                   ORGANIZATION IS TRANSACTION

                   ACCESS IS SEQUENTIAL.

 

       DATA DIVISION.

       FILE SECTION.

 

       FD  TESTFILE

           LABEL RECORDS ARE OMITTED.

       01  TEST-RECORD                       PIC X(100).

      *

       WORKING-STORAGE SECTION.

 

       01  SCREEN-OUT.

           COPY DD-TESTRCD-O OF TESTDSPF.

       01  SCREEN-IN.

           COPY DD-TESTRCD-I OF TESTDSPF.

 

 

       01  INDICATOR-AREA.

           06  INDICATOR-TABLE  OCCURS 99 PIC 1 INDICATOR 1.

               88 IND-OFF                    VALUE B"0".

               88 IND-ON                     VALUE B"1".

 

       01  WS-C-IND-ON                             PIC 1    VALUE B"1".

       01  WS-C-IND-OFF                            PIC 1    VALUE B"0".

       PROCEDURE DIVISION.

 

       100-MAINLINE.

 

           OPEN I-O TESTFILE.

      *    MOVE ZEROS TO CHGLSC OF SCREEN-IN.

           MOVE ZEROS TO CHGLSC OF SCREEN-OUT.

 

           PERFORM PROCESS-SCREEN THRU

                   PROCESS-SCREEN-EXIT UNTIL

                   INDICATOR-TABLE(03) = WS-C-IND-ON.

 

           STOP RUN.

 

       100-MAINLINE-EXIT.

           EXIT.

      *

       PROCESS-SCREEN.

 

           WRITE TEST-RECORD FROM

           SCREEN-OUT

           FORMAT IS "TESTRCD"

           INDICATORS ARE INDICATOR-TABLE

 

           READ TESTFILE INTO

           SCREEN-IN

           FORMAT IS "TESTRCD"

           INDICATORS ARE INDICATOR-AREA

 

           IF CHGLSC OF SCREEN-IN > 0

 

           MOVE CHGLSC OF SCREEN-IN TO CHGLSC OF SCREEN-OUT

           ELSE

           MOVE ZEROS TO CHGLSC OF SCREEN-OUT

 

           END-IF

 

           IF CHGLSC OF SCREEN-IN > 1000

              MOVE WS-C-IND-ON TO INDICATOR-TABLE(54)

              MOVE WS-C-IND-ON TO INDICATOR-TABLE(53)

           ELSE

              MOVE WS-C-IND-OFF TO INDICATOR-TABLE(54)

              MOVE WS-C-IND-OFF TO INDICATOR-TABLE(53)

           END-IF.

 

       PROCESS-SCREEN-EXIT.

           EXIT.

 

 

Hope this works,

Regards,

 

 

 

 



DISCLAIMER:
This email (including any attachments) is intended for the sole use of the 
intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE 
COMPANY INFORMATION. Any review or reliance by others or copying or 
distribution or forwarding of any or all of the contents in this message is 
STRICTLY PROHIBITED. If you are not the intended recipient, please contact the 
sender by email and delete all copies; your cooperation in this regard is 
appreciated.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.