gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [open-cobol-list] open-cobol-list Digest, Vol 46, Issue 4


From: rathin
Subject: Re: [open-cobol-list] open-cobol-list Digest, Vol 46, Issue 4
Date: Thu, 23 Dec 2010 16:24:19 +0530

sir,
     thank you, but it would be the best if libcob.so.1 be included in the exe
so that it would be machine independent. Is there any procedure to include the file
in the exe so that the executable can be run on any machine without any dependancy.

thanking you
rathin
On Wed, 2010-12-22 at 23:55 +0530, address@hidden wrote:
Send open-cobol-list mailing list submissions to
        address@hidden

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/open-cobol-list
or, via email, send a message with subject or body 'help' to
        address@hidden

You can reach the person managing the list at
        address@hidden

When replying, please edit your Subject line so it is more specific
than "Re: Contents of open-cobol-list digest..."


Today's Topics:

   1. Re: open-cobol-list Digest, Vol 46, Issue 2 (Alain)


----------------------------------------------------------------------

Message: 1
Date: Wed, 22 Dec 2010 19:24:02 +0100
From: Alain <address@hidden>
Subject: Re: [open-cobol-list] open-cobol-list Digest, Vol 46, Issue 2
To: address@hidden
Message-ID: <address@hidden>
Content-Type: text/plain; charset=US-ASCII

Hello,
If you are using Linux,try with
COB_LIBRARY_PATH=.:/usr/local/lib/
in your environment
--
Alain <address@hidden>



On Wed, 22 Dec 2010 10:40:56 +0530
rathin <address@hidden> wrote:

> Thank you Sir, for your very quick response . the program has been
> understood but whenever i execute it
> an error line shows
>
> ./test1: error while loading shared libraries: libcob.so.1: cannot open
> shared object file: No such file or directory
>
> but the libcob.so.1 resides in /usr/local/lib as seen below
>
> address@hidden ~]# locate libcob.so.1
> /usr/local/lib/libcob.so.1
> /usr/local/lib/libcob.so.1.0.0
>
> please suggest to eliminate this error of shared libraries.
>
> thanking you
> rathin
>
> On Wed, 2010-12-22 at 05:10 +0530, open-cobol-list-
> address@hidden wrote:
>
> > Send open-cobol-list mailing list submissions to
> >         address@hidden
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> >         https://lists.sourceforge.net/lists/listinfo/open-cobol-list
> > or, via email, send a message with subject or body 'help' to
> >         address@hidden
> >
> > You can reach the person managing the list at
> >         address@hidden
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of open-cobol-list digest..."
> >
> >
> > Today's Topics:
> >
> >    1. Re: PLEASE HELP new to coboL PROGRAMMING (Vince Coen)
> >    2. Re: PLEASE HELP new to coboL PROGRAMMING (John Culleton)
> >    3. Re: PLEASE HELP new to coboL PROGRAMMING (Dave Stratford)
> >
> >
> > ----------------------------------------------------------------------
> >
> > Message: 1
> > Date: Mon, 20 Dec 2010 13:24:51 +0000
> > From: Vince Coen <address@hidden>
> > Subject: Re: [open-cobol-list] PLEASE HELP new to coboL PROGRAMMING
> > To: address@hidden
> > Message-ID: <address@hidden>
> > Content-Type: Text/Plain;  charset="utf-8"
> >
> > Hi;
> >
> > On Monday 20 Dec 2010, rathin wrote:
> > > SIR,
> > >        I AM NEW TO COBOL PROGRAMMING . IT WOULD BE VERY KIND OF YOU IF
> > > IT BE TAUGHT BY EXAMPLE BELOW IS A PROGRAM TAKEN FROM THE NET. SO SIR
> > > IF YOU CAN KINDLY PUT IT IN THE OPEN COBOL FORMAT THAN IT WOULD BE
> > > EASIER FOR ME TO UNDERSTAND.
> > > I SUCCESSFULLY INSTALLED OPEN COBOL 1.0 AND THE COBC HAS BEEN
> > > SUCCESSFULLY COMPILED.
> > > SIR KINDLY CHANGE IT TO OPEN COBOL FORMAT SO THAT I CAN IDENTIFY THE
> > > DIFFERENCE AND LEARN IT STEP BY STEP
> >
> > It not exactly difficult but first stop writing in upper case, use normal text
> > and case e.g, the same as this!
> >
> > 1. Remove leading spaces so that Cobol text starts at column 1 for all
> > sections and division headers and col 2 or more for all others.
> > 2. Replace all comment lines containing '* '  with '*>'
> > 3. Add as line one but starting at column 8 >>source free
> > 4. Cobol does not require all text in upper case so change case to suite your
> >      needs.
> > 5. Upgrade open cobol to version 1.1 or later
> >
> > [Note that my email editor as messed up spacing in code so that left hand
> > start position is moved left]
> >
> > Example :
> >
> >        >>source free
> > identification division.
> > program-id.      test1.
> > environment division.
> > configuration section.
> > input-output section.
> > file-control.
> >      select tax-table-file assign "input-file"
> >                            organization line sequential.
> >      select salary-file assign "input-file"
> >                         organization line sequential.
> >      select salary-report assign "output-file"
> >                           organization line sequential.
> > data division.
> > file section.
> > *>
> > fd  tax-table-file.
> > 01  tax-table-rec.
> >     05  t-max-tax-income             pic 9(06).
> >     05  t-fed-tax                    pic v9(3).
> >     05  t-state-tax                  pic v9(3).
> >     05                               pic x(68).
> > fd  salary-file.
> > 01  salary-file-rec.
> >     05  employee-no                  pic 9(05).
> >     05  employee-name                pic x(20).
> >     05                               pic x(03).
> >     05  annual-salary                pic 9(05).
> >     05                               pic x(08).
> >     05  no-dependents                pic 9(01).
> >     05                               pic x(38).
> > fd  salary-report
> >     record contains 80 characters.
> > 01  salary-report-rec                pic x(80).
> > *>
> > working-storage section.
> > 01  working-items.
> >     05  more-recs                    pic x(01).
> >     05  x1                           pic 9(02).
> >     05  more-table-recs              pic x(01)  value 'Y'.
> >     05  fed-tax-deduction            pic 9(05).
> >     05  state-tax-deduction          pic 9(05).
> >     05  monthly-take-home-pay        pic 9(05)v9(02).
> >     05  found-match                  pic x(01)  value 'N'.
> >     05  temp-income                  pic 9(06)  value zeroes.
> > 01  ws-date.
> >     05  ws-date-year                 pic 9(02).
> >     05  ws-date-month                pic 9(02).
> >     05  ws-date-day                  pic 9(02).
> > 01  ws-report-date.
> >     05  rd-month                     pic 9(02).
> >     05                               pic x(01)  value '/'.
> >     05  rd-day                       pic 9(02).
> >     05                               pic x(01)  value '/'.
> >     05  rd-year                      pic 9(02).
> > 01  tax-table.
> >     05  table-entries occurs 6 times.
> >         10  ws-max-tax-income        pic 9(06).
> >         10  ws-fed-tax               pic v9(3).
> >         10  ws-state-tax             pic v9(3).
> > 01  header-1.
> >     05                               pic x(12).
> >     05                               pic x(21)  value 'MONTHLY SALARY REPORT'.
> >     05                               pic x(03).
> >     05  date-out                     pic 99/99/99.
> >     05                               pic x(02).
> > *>  05                               pic x(04)  value 'PAGE'.
> > *>  05  page-out                     pic 9(02).
> > 01  header-2.
> >     05                               pic x(08)  value 'EMPLOYEE'.
> >     05                               pic x(19).
> >     05                               pic x(17)  value 'MONTHLY TAKE HOME'.
> > 01  header-3.
> >     05                               pic x(02).
> >     05                               pic x(04)  value 'NAME'.
> >     05                               pic x(28).
> >     05                               pic x(03)  value 'PAY'.
> > 01  list-line-1.
> >     05  employee-name-out            pic x(20).
> >     05                               pic x(11).
> >     05  monthly-take-home-pay-out    pic $zz,zzz.99.
> > 01  list-line-2.
> >     05                               pic x(05).
> >     05                               pic x(35) value 'No match was found in
> > the tax table'.
> > procedure division.
> > 000-main-rtn.
> >     perform 100-initialize-rtn
> >     perform 200-table-entry
> >     perform 300-process-rtn until more-recs = 'N'
> >     perform 900-close-files-rtn.
> > 100-initialize-rtn.
> >     open input  tax-table-file
> >                 salary-file
> >          output salary-report
> >     move 'Y' to more-recs
> >     perform 110-set-date-rtn
> >     perform 120-write-headers-rtn.
> > 110-set-date-rtn.
> >     accept ws-date from date
> >     move ws-date-year to rd-year
> >     move ws-date-month to rd-month
> >     move ws-date-day to rd-day
> >     move ws-report-date to date-out.
> > 120-write-headers-rtn.
> >     write salary-report-rec from header-1 after 5
> >     write salary-report-rec from header-2 after 2
> >     write salary-report-rec from header-3 after 1.
> > 200-table-entry.
> >     perform varying x1 from 1 by 1 until x1 >  7 or more-table-recs = 'N'
> >         read tax-table-file
> >             at end
> >                 move 'N' to more-table-recs
> >             not at end
> >                 perform 250-table-load
> >         end-read
> >     end-perform
> >     if x1 < 7
> >         display 'Too few records in the file'
> >     end-if
> >     if more-table-recs not = 'N'
> >         display 'Too many records in the file'
> >     end-if.
> > 250-table-load.
> >     move t-max-tax-income to ws-max-tax-income (x1)
> >     move t-fed-tax to ws-fed-tax (x1)
> >     move t-state-tax to ws-state-tax (x1).
> > 300-process-rtn.
> >     read salary-file at end
> >             move 'N' to more-recs
> >                      not at end
> >             perform 350-compare-rtn
> >     end-read.
> > 350-compare-rtn.
> >     move 1 to x1
> >     perform 353-increment-subscript-rtn  until found-match = 'Y' or x1 >  7
> >     if x1 >  7 and found-match = 'N'
> >         then write salary-report-rec from list-line-2
> >         continue
> >     end-if
> >     perform 356-calculate-rtn
> >     perform 359-write-rtn
> >     move 'N' to found-match
> >     move zeroes to temp-income.
> > 353-increment-subscript-rtn.
> >     if annual-salary >  temp-income and <= ws-max-tax-income (x1)
> >         then move 'Y' to found-match
> >     else
> >         move ws-max-tax-income (x1) to temp-income
> >         add 1 to x1
> >     end-if.
> > 356-calculate-rtn.
> >     compute fed-tax-deduction =   annual-salary * ws-fed-tax (x1)
> >     compute state-tax-deduction = annual-salary * ws-state-tax (x1)
> >     compute monthly-take-home-pay = (annual-salary - (fed-tax-deduction +
> > state-tax-deduction))/12.
> > 359-write-rtn.
> >     move employee-name to employee-name-out
> >     move monthly-take-home-pay to monthly-take-home-pay-out
> >     write salary-report-rec from list-line-1 after 1.
> > 900-close-files-rtn.
> >     close tax-table-file
> >           salary-file
> >           salary-report
> >     stop run.
> >
> >
> >
> > ------------------------------
> >
> > Message: 2
> > Date: Mon, 20 Dec 2010 11:13:40 -0500
> > From: John Culleton <address@hidden>
> > Subject: Re: [open-cobol-list] PLEASE HELP new to coboL PROGRAMMING
> > To: address@hidden
> > Message-ID: <address@hidden>
> > Content-Type: Text/Plain;  charset="iso-8859-15"
> >
> > On Monday 20 December 2010 07:19:43 rathin wrote:
> > > IDENTIFICATION DIVISION.
> > (etc.)
> >
> > The program is written in the older fixed format. It conforms to COBOL
> > 85  apparently.
> >
> > Only a few changes are needed.
> > Put seven spaces before IDENTIFICATION DIVISION.
> > You need to add a PROGRAM-ID. paragraph.
> > The LABEL RECORDS ARE STANDARD clause is obsolete and should be
> > eliminated.
> > The RECORD CONTAINS 80 CHARACTERS clause is obsolete and should be
> > eliminated.
> >
> > Don.t forget to put a period at the end of the FD lines in each case.
> >
> >
> > With these few changes the program as you submitted it compiles
> > without error using
> >
> > cobc -x cobsamp.cbl
> >
> > The corrected program is listed below. Note that DIVISION, SECTION, FD
> > and 01 headers begin with seven spaces.  Named paragraphs begin with
> > 7 spaces. Other lines in your sample begin with 9 spaces, but should
> > really begin with 11 spaces to conform to the old fixed format.
> > --------------------------------------
> >       IDENTIFICATION DIVISION.
> >        PROGRAM-ID. SAMPLE.
> >        ENVIRONMENT DIVISION.
> >        CONFIGURATION SECTION.
> >        INPUT-OUTPUT SECTION.
> >        FILE-CONTROL.
> >            SELECT TAX-TABLE-FILE ASSIGN TO  "INPUT-FILE"
> >                                     ORGANIZATION IS LINE SEQUENTIAL.
> >            SELECT SALARY-FILE ASSIGN TO "INPUT-FILE"
> >                   ORGANIZATION IS LINE SEQUENTIAL.
> >            SELECT SALARY-REPORT ASSIGN TO "OUTPUT-FILE"
> >                   ORGANIZATION IS LINE SEQUENTIAL.
> >        DATA DIVISION.
> >        FILE SECTION.
> >       *
> >        FD  TAX-TABLE-FILE.
> >        01  TAX-TABLE-REC.
> >            05  T-MAX-TAX-INCOME             PIC 9(06).
> >            05  T-FED-TAX                    PIC V9(3).
> >            05  T-STATE-TAX                  PIC V9(3).
> >            05                               PIC X(68).
> >        FD  SALARY-FILE.
> >        01  SALARY-FILE-REC.
> >            05  EMPLOYEE-NO                  PIC 9(05).
> >            05  EMPLOYEE-NAME                PIC X(20).
> >            05                               PIC X(03).
> >            05  ANNUAL-SALARY                PIC 9(05).
> >            05                               PIC X(08).
> >            05  NO-DEPENDENTS                PIC 9(01).
> >            05                               PIC X(38).
> >        FD  SALARY-REPORT.
> >        01  SALARY-REPORT-REC                PIC X(80).
> >       *
> >        WORKING-STORAGE SECTION.
> >        01  WORKING-ITEMS.
> >            05  MORE-RECS                    PIC X(01).
> >            05  X1                           PIC 9(02).
> >            05  MORE-TABLE-RECS              PIC X(01)  VALUE 'Y'.
> >            05  FED-TAX-DEDUCTION            PIC 9(05).
> >            05  STATE-TAX-DEDUCTION          PIC 9(05).
> >            05  MONTHLY-TAKE-HOME-PAY        PIC 9(05)V9(02).
> >            05  FOUND-MATCH                  PIC X(01)  VALUE 'N'.
> >            05  TEMP-INCOME                  PIC 9(06)  VALUE ZEROES.
> >        01  WS-DATE.
> >            05  WS-DATE-YEAR                 PIC 9(02).
> >            05  WS-DATE-MONTH                PIC 9(02).
> >            05  WS-DATE-DAY                  PIC 9(02).
> >        01  WS-REPORT-DATE.
> >            05  RD-MONTH                     PIC 9(02).
> >            05                               PIC X(01)  VALUE '/'.
> >            05  RD-DAY                       PIC 9(02).
> >            05                               PIC X(01)  VALUE '/'.
> >            05  RD-YEAR                      PIC 9(02).
> >        01  TAX-TABLE.
> >            05  TABLE-ENTRIES OCCURS 6 TIMES.
> >                10  WS-MAX-TAX-INCOME        PIC 9(06).
> >                10  WS-FED-TAX               PIC V9(3).
> >                10  WS-STATE-TAX             PIC V9(3).
> >        01  HEADER-1.
> >            05                               PIC X(12).
> >            05                               PIC X(21)  VALUE
> >                            'MONTHLY SALARY REPORT'.
> >            05                               PIC X(03).
> >            05  DATE-OUT                     PIC 99/99/99.
> >            05                               PIC X(02).
> >       *    05                               PIC X(04)  VALUE
> >       *                    'PAGE'.
> >       *    05  PAGE-OUT                     PIC 9(02).
> >        01  HEADER-2.
> >            05                               PIC X(08)  VALUE
> >                            'EMPLOYEE'.
> >            05                               PIC X(19).
> >            05                               PIC X(17)  VALUE
> >                            'MONTHLY TAKE HOME'.
> >        01  HEADER-3.
> >            05                               PIC X(02).
> >            05                               PIC X(04)  VALUE
> >                            'NAME'.
> >            05                               PIC X(28).
> >            05                               PIC X(03)  VALUE
> >                            'PAY'.
> >        01  LIST-LINE-1.
> >            05  EMPLOYEE-NAME-OUT            PIC X(20).
> >            05                               PIC X(11).
> >            05  MONTHLY-TAKE-HOME-PAY-OUT    PIC $ZZ,ZZZ.99.
> >        01  LIST-LINE-2.
> >            05                               PIC X(05).
> >            05                               PIC X(35) VALUE
> >                            'NO MATCH WAS FOUND IN THE TAX TABLE'.
> >        PROCEDURE DIVISION.
> >        000-MAIN-RTN.
> >            PERFORM 100-INITIALIZE-RTN
> >            PERFORM 200-TABLE-ENTRY
> >            PERFORM 300-PROCESS-RTN
> >                        UNTIL MORE-RECS = 'N'
> >            PERFORM 900-CLOSE-FILES-RTN.
> >        100-INITIALIZE-RTN.
> >            OPEN INPUT  TAX-TABLE-FILE
> >                        SALARY-FILE
> >                 OUTPUT SALARY-REPORT
> >            MOVE 'Y' TO MORE-RECS
> >            PERFORM 110-SET-DATE-RTN
> >            PERFORM 120-WRITE-HEADERS-RTN.
> >        110-SET-DATE-RTN.
> >            ACCEPT WS-DATE FROM DATE
> >            MOVE WS-DATE-YEAR TO RD-YEAR
> >            MOVE WS-DATE-MONTH TO RD-MONTH
> >            MOVE WS-DATE-DAY TO RD-DAY
> >            MOVE WS-REPORT-DATE TO DATE-OUT.
> >        120-WRITE-HEADERS-RTN.
> >            WRITE SALARY-REPORT-REC FROM HEADER-1
> >                          AFTER ADVANCING 5 LINES
> >            WRITE SALARY-REPORT-REC FROM HEADER-2
> >                          AFTER ADVANCING 2 LINES
> >            WRITE SALARY-REPORT-REC FROM HEADER-3
> >                           AFTER ADVANCING 1 LINE.
> >        200-TABLE-ENTRY.
> >            PERFORM VARYING X1 FROM 1 BY 1
> >                            UNTIL X1 > 7 OR MORE-TABLE-RECS = 'N'
> >                READ TAX-TABLE-FILE
> >                    AT END
> >                        MOVE 'N' TO MORE-TABLE-RECS
> >                    NOT AT END
> >                        PERFORM 250-TABLE-LOAD
> >                END-READ
> >            END-PERFORM
> >            IF X1 < 7
> >                DISPLAY 'TOO FEW RECORDS IN THE FILE'
> >            END-IF
> >            IF MORE-TABLE-RECS NOT = 'N'
> >                DISPLAY 'TOO MANY RECORDS IN THE FILE'
> >            END-IF.
> >        250-TABLE-LOAD.
> >            MOVE T-MAX-TAX-INCOME TO WS-MAX-TAX-INCOME (X1)
> >            MOVE T-FED-TAX TO WS-FED-TAX (X1)
> >            MOVE T-STATE-TAX TO WS-STATE-TAX (X1).
> >        300-PROCESS-RTN.
> >            READ SALARY-FILE
> >                AT END
> >                    MOVE 'N' TO MORE-RECS
> >                NOT AT END
> >                    PERFORM 350-COMPARE-RTN
> >            END-READ.
> >        350-COMPARE-RTN.
> >            MOVE 1 TO X1
> >            PERFORM 353-INCREMENT-SUBSCRIPT-RTN
> >                           UNTIL FOUND-MATCH = 'Y' OR X1 > 7
> >            IF X1 > 7 AND FOUND-MATCH = 'N'
> >                THEN WRITE SALARY-REPORT-REC FROM LIST-LINE-2
> >                CONTINUE
> >            END-IF
> >            PERFORM 356-CALCULATE-RTN
> >            PERFORM 359-WRITE-RTN
> >            MOVE 'N' TO FOUND-MATCH
> >            MOVE ZEROES TO TEMP-INCOME.
> >        353-INCREMENT-SUBSCRIPT-RTN.
> >            IF ANNUAL-SALARY > TEMP-INCOME AND <= WS-MAX-TAX-INCOME
> > (X1)
> >                THEN MOVE 'Y' TO FOUND-MATCH
> >            ELSE
> >                MOVE WS-MAX-TAX-INCOME (X1) TO TEMP-INCOME
> >                ADD 1 TO X1
> >            END-IF.
> >        356-CALCULATE-RTN.
> >            COMPUTE FED-TAX-DEDUCTION =
> >                       ANNUAL-SALARY * WS-FED-TAX (X1)
> >            COMPUTE STATE-TAX-DEDUCTION =
> >                       ANNUAL-SALARY * WS-STATE-TAX (X1)
> >            COMPUTE MONTHLY-TAKE-HOME-PAY = (ANNUAL-SALARY -
> >                         (FED-TAX-DEDUCTION + STATE-TAX-DEDUCTION))/12.
> >        359-WRITE-RTN.
> >            MOVE EMPLOYEE-NAME TO EMPLOYEE-NAME-OUT
> >            MOVE MONTHLY-TAKE-HOME-PAY TO MONTHLY-TAKE-HOME-PAY-OUT
> >            WRITE SALARY-REPORT-REC FROM LIST-LINE-1
> >                             AFTER ADVANCING 1 LINE.
> >        900-CLOSE-FILES-RTN.
> >            CLOSE TAX-TABLE-FILE
> >                  SALARY-FILE
> >                  SALARY-REPORT
> >            STOP RUN.
> >
> > Of course the program will not run unless the two input files are
> > available.
> >
> > To learn COBOL I recommend purchase of a good textbook, (in this case
> > the older the better) and of course study of the Open Cobol Manual
> > which is an excellent reference guide.
> > --
> > John Culleton,
> >  typesetting and indexing http://wexfordpress.com
> > book sales http://wexfordpress.net
> > Free  barcode: http://www.tux.org/~milgram/bookland/
> >
> >
> >
> >
> > ------------------------------
> >
> > Message: 3
> > Date: Tue, 21 Dec 2010 23:08:24 -0000 (GMT)
> > From: "Dave Stratford" <address@hidden>
> > Subject: Re: [open-cobol-list] PLEASE HELP new to coboL PROGRAMMING
> > To: address@hidden
> > Message-ID:
> >         <address@hidden>
> > Content-Type: text/plain;charset=iso-8859-1
> >
> >
> > John Culleton wrote:
> > > On Monday 20 December 2010 07:19:43 rathin wrote:
> > >> IDENTIFICATION DIVISION.
> > > (etc.)
> > >
> > > The program is written in the older fixed format. It conforms to COBOL
> > > 85  apparently.
> > >
> > > Only a few changes are needed.
> > > Put seven spaces before IDENTIFICATION DIVISION.
> >
> > 7 to 10 spaces.
> >
> > > You need to add a PROGRAM-ID. paragraph.
> > > The LABEL RECORDS ARE STANDARD clause is obsolete and should be
> > > eliminated.
> > > The RECORD CONTAINS 80 CHARACTERS clause is obsolete and should be
> > > eliminated.
> >
> > Haven't cheecked the OC compiler, but will the presence of these cause is
> > to barf, or will it simply ignore them? My understanding of the COBOL
> > standards is that it should accept them but ignore them.
> >
> > > Don.t forget to put a period at the end of the FD lines in each case.
> > >
> > >
> > > With these few changes the program as you submitted it compiles
> > > without error using
> > >
> > > cobc -x cobsamp.cbl
> > >
> > > The corrected program is listed below. Note that DIVISION, SECTION, FD
> > > and 01 headers begin with seven spaces.  Named paragraphs begin with
> > > 7 spaces. Other lines in your sample begin with 9 spaces, but should
> > > really begin with 11 spaces to conform to the old fixed format.
> >
> > 7 to 10 spaces is column A, 11 to 72 is column B. Some elements MUST start
> > in column A, some MUST start in column B, a few can start in either area.
> > But, most importantly, can start anywhere within that area.
> >
> > Division, Section and Paragraph headers must start in A, WS level numbers
> > can be in A or B, most(all?) other bits must start somehwere in column B.
> >
> > > --------------------------------------
> > >       IDENTIFICATION DIVISION.
> > >        PROGRAM-ID. SAMPLE.
> > >        ENVIRONMENT DIVISION.
> > >        CONFIGURATION SECTION.
> > >        INPUT-OUTPUT SECTION.
> > >        FILE-CONTROL.
> > >            SELECT TAX-TABLE-FILE ASSIGN TO  "INPUT-FILE"
> > >                                     ORGANIZATION IS LINE SEQUENTIAL.
> > >            SELECT SALARY-FILE ASSIGN TO "INPUT-FILE"
> > >                   ORGANIZATION IS LINE SEQUENTIAL.
> > >            SELECT SALARY-REPORT ASSIGN TO "OUTPUT-FILE"
> > >                   ORGANIZATION IS LINE SEQUENTIAL.
> > >        DATA DIVISION.
> > >        FILE SECTION.
> > >       *
> > >        FD  TAX-TABLE-FILE.
> > >        01  TAX-TABLE-REC.
> > >            05  T-MAX-TAX-INCOME             PIC 9(06).
> > >            05  T-FED-TAX                    PIC V9(3).
> > >            05  T-STATE-TAX                  PIC V9(3).
> > >            05                               PIC X(68).
> > >        FD  SALARY-FILE.
> > >        01  SALARY-FILE-REC.
> > >            05  EMPLOYEE-NO                  PIC 9(05).
> > >            05  EMPLOYEE-NAME                PIC X(20).
> > >            05                               PIC X(03).
> > >            05  ANNUAL-SALARY                PIC 9(05).
> > >            05                               PIC X(08).
> > >            05  NO-DEPENDENTS                PIC 9(01).
> > >            05                               PIC X(38).
> > >        FD  SALARY-REPORT.
> > >        01  SALARY-REPORT-REC                PIC X(80).
> > >       *
> > >        WORKING-STORAGE SECTION.
> > >        01  WORKING-ITEMS.
> > >            05  MORE-RECS                    PIC X(01).
> > >            05  X1                           PIC 9(02).
> > >            05  MORE-TABLE-RECS              PIC X(01)  VALUE 'Y'.
> > >            05  FED-TAX-DEDUCTION            PIC 9(05).
> > >            05  STATE-TAX-DEDUCTION          PIC 9(05).
> > >            05  MONTHLY-TAKE-HOME-PAY        PIC 9(05)V9(02).
> > >            05  FOUND-MATCH                  PIC X(01)  VALUE 'N'.
> > >            05  TEMP-INCOME                  PIC 9(06)  VALUE ZEROES.
> > >        01  WS-DATE.
> > >            05  WS-DATE-YEAR                 PIC 9(02).
> > >            05  WS-DATE-MONTH                PIC 9(02).
> > >            05  WS-DATE-DAY                  PIC 9(02).
> > >        01  WS-REPORT-DATE.
> > >            05  RD-MONTH                     PIC 9(02).
> > >            05                               PIC X(01)  VALUE '/'.
> > >            05  RD-DAY                       PIC 9(02).
> > >            05                               PIC X(01)  VALUE '/'.
> > >            05  RD-YEAR                      PIC 9(02).
> > >        01  TAX-TABLE.
> > >            05  TABLE-ENTRIES OCCURS 6 TIMES.
> > >                10  WS-MAX-TAX-INCOME        PIC 9(06).
> > >                10  WS-FED-TAX               PIC V9(3).
> > >                10  WS-STATE-TAX             PIC V9(3).
> > >        01  HEADER-1.
> > >            05                               PIC X(12).
> > >            05                               PIC X(21)  VALUE
> > >                            'MONTHLY SALARY REPORT'.
> > >            05                               PIC X(03).
> > >            05  DATE-OUT                     PIC 99/99/99.
> > >            05                               PIC X(02).
> > >       *    05                               PIC X(04)  VALUE
> > >       *                    'PAGE'.
> > >       *    05  PAGE-OUT                     PIC 9(02).
> > >        01  HEADER-2.
> > >            05                               PIC X(08)  VALUE
> > >                            'EMPLOYEE'.
> > >            05                               PIC X(19).
> > >            05                               PIC X(17)  VALUE
> > >                            'MONTHLY TAKE HOME'.
> > >        01  HEADER-3.
> > >            05                               PIC X(02).
> > >            05                               PIC X(04)  VALUE
> > >                            'NAME'.
> > >            05                               PIC X(28).
> > >            05                               PIC X(03)  VALUE
> > >                            'PAY'.
> > >        01  LIST-LINE-1.
> > >            05  EMPLOYEE-NAME-OUT            PIC X(20).
> > >            05                               PIC X(11).
> > >            05  MONTHLY-TAKE-HOME-PAY-OUT    PIC $ZZ,ZZZ.99.
> > >        01  LIST-LINE-2.
> > >            05                               PIC X(05).
> > >            05                               PIC X(35) VALUE
> > >                            'NO MATCH WAS FOUND IN THE TAX TABLE'.
> > >        PROCEDURE DIVISION.
> > >        000-MAIN-RTN.
> > >            PERFORM 100-INITIALIZE-RTN
> > >            PERFORM 200-TABLE-ENTRY
> > >            PERFORM 300-PROCESS-RTN
> > >                        UNTIL MORE-RECS = 'N'
> > >            PERFORM 900-CLOSE-FILES-RTN.
> > >        100-INITIALIZE-RTN.
> > >            OPEN INPUT  TAX-TABLE-FILE
> > >                        SALARY-FILE
> > >                 OUTPUT SALARY-REPORT
> > >            MOVE 'Y' TO MORE-RECS
> > >            PERFORM 110-SET-DATE-RTN
> > >            PERFORM 120-WRITE-HEADERS-RTN.
> > >        110-SET-DATE-RTN.
> > >            ACCEPT WS-DATE FROM DATE
> > >            MOVE WS-DATE-YEAR TO RD-YEAR
> > >            MOVE WS-DATE-MONTH TO RD-MONTH
> > >            MOVE WS-DATE-DAY TO RD-DAY
> > >            MOVE WS-REPORT-DATE TO DATE-OUT.
> > >        120-WRITE-HEADERS-RTN.
> > >            WRITE SALARY-REPORT-REC FROM HEADER-1
> > >                          AFTER ADVANCING 5 LINES
> > >            WRITE SALARY-REPORT-REC FROM HEADER-2
> > >                          AFTER ADVANCING 2 LINES
> > >            WRITE SALARY-REPORT-REC FROM HEADER-3
> > >                           AFTER ADVANCING 1 LINE.
> > >        200-TABLE-ENTRY.
> > >            PERFORM VARYING X1 FROM 1 BY 1
> > >                            UNTIL X1 > 7 OR MORE-TABLE-RECS = 'N'
> > >                READ TAX-TABLE-FILE
> > >                    AT END
> > >                        MOVE 'N' TO MORE-TABLE-RECS
> > >                    NOT AT END
> > >                        PERFORM 250-TABLE-LOAD
> > >                END-READ
> > >            END-PERFORM
> > >            IF X1 < 7
> > >                DISPLAY 'TOO FEW RECORDS IN THE FILE'
> > >            END-IF
> > >            IF MORE-TABLE-RECS NOT = 'N'
> > >                DISPLAY 'TOO MANY RECORDS IN THE FILE'
> > >            END-IF.
> > >        250-TABLE-LOAD.
> > >            MOVE T-MAX-TAX-INCOME TO WS-MAX-TAX-INCOME (X1)
> > >            MOVE T-FED-TAX TO WS-FED-TAX (X1)
> > >            MOVE T-STATE-TAX TO WS-STATE-TAX (X1).
> > >        300-PROCESS-RTN.
> > >            READ SALARY-FILE
> > >                AT END
> > >                    MOVE 'N' TO MORE-RECS
> > >                NOT AT END
> > >                    PERFORM 350-COMPARE-RTN
> > >            END-READ.
> > >        350-COMPARE-RTN.
> > >            MOVE 1 TO X1
> > >            PERFORM 353-INCREMENT-SUBSCRIPT-RTN
> > >                           UNTIL FOUND-MATCH = 'Y' OR X1 > 7
> > >            IF X1 > 7 AND FOUND-MATCH = 'N'
> > >                THEN WRITE SALARY-REPORT-REC FROM LIST-LINE-2
> > >                CONTINUE
> > >            END-IF
> > >            PERFORM 356-CALCULATE-RTN
> > >            PERFORM 359-WRITE-RTN
> > >            MOVE 'N' TO FOUND-MATCH
> > >            MOVE ZEROES TO TEMP-INCOME.
> > >        353-INCREMENT-SUBSCRIPT-RTN.
> > >            IF ANNUAL-SALARY > TEMP-INCOME AND <= WS-MAX-TAX-INCOME
> > > (X1)
> > >                THEN MOVE 'Y' TO FOUND-MATCH
> > >            ELSE
> > >                MOVE WS-MAX-TAX-INCOME (X1) TO TEMP-INCOME
> > >                ADD 1 TO X1
> > >            END-IF.
> > >        356-CALCULATE-RTN.
> > >            COMPUTE FED-TAX-DEDUCTION =
> > >                       ANNUAL-SALARY * WS-FED-TAX (X1)
> > >            COMPUTE STATE-TAX-DEDUCTION =
> > >                       ANNUAL-SALARY * WS-STATE-TAX (X1)
> > >            COMPUTE MONTHLY-TAKE-HOME-PAY = (ANNUAL-SALARY -
> > >                         (FED-TAX-DEDUCTION + STATE-TAX-DEDUCTION))/12.
> > >        359-WRITE-RTN.
> > >            MOVE EMPLOYEE-NAME TO EMPLOYEE-NAME-OUT
> > >            MOVE MONTHLY-TAKE-HOME-PAY TO MONTHLY-TAKE-HOME-PAY-OUT
> > >            WRITE SALARY-REPORT-REC FROM LIST-LINE-1
> > >                             AFTER ADVANCING 1 LINE.
> > >        900-CLOSE-FILES-RTN.
> > >            CLOSE TAX-TABLE-FILE
> > >                  SALARY-FILE
> > >                  SALARY-REPORT
> > >            STOP RUN.
> > >
> > > Of course the program will not run unless the two input files are
> > > available.
> > >
> > > To learn COBOL I recommend purchase of a good textbook, (in this case
> > > the older the better) and of course study of the Open Cobol Manual
> > > which is an excellent reference guide.
> > > --
> > > John Culleton,
> > >  typesetting and indexing http://wexfordpress.com
> > > book sales http://wexfordpress.net
> > > Free  barcode: http://www.tux.org/~milgram/bookland/
> > >
> > >
> > > ----------------------------------------------------------------------------
> >
> > Dave
> >
> > --
> >
> >
> >
> >
> >
> > ------------------------------
> >
> > ------------------------------------------------------------------------------
> > Forrester recently released a report on the Return on Investment (ROI) of
> > Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
> > within 7 months.  Over 3 million businesses have gone Google with Google Apps:
> > an online email calendar, and document program that's accessible from your
> > browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
> >
> > ------------------------------
> >
> > _______________________________________________
> > open-cobol-list mailing list
> > address@hidden
> > https://lists.sourceforge.net/lists/listinfo/open-cobol-list
> >
> >
> > End of open-cobol-list Digest, Vol 46, Issue 2
> > **********************************************
>
> "The information contained in this electronic message and any attachments to this
> message are intended for exclusive use of the addressee(s) and may contain
> confidential or privileged information. If you are not the intended recipient, please
> notify the sender at LIC OF INDIA or address@hidden immediately and
> destroy all copies of this message and any attachments. The views expressed in
> this E-mail message / Attachments, are those of the individual sender."




------------------------------

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl

------------------------------

_______________________________________________
open-cobol-list mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/open-cobol-list


End of open-cobol-list Digest, Vol 46, Issue 4
**********************************************
"The information contained in this electronic message and any attachments to this 
message are intended for exclusive use of the addressee(s) and may contain 
confidential or privileged information. If you are not the intended recipient, please 
notify the sender at LIC OF INDIA or address@hidden immediately and 
destroy all copies of this message and any attachments. The views expressed in 
this E-mail message / Attachments, are those of the individual sender."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]