Menu

Now it's PIC Z!

Tom Lake
2023-05-26
2023-05-28
  • Tom Lake

    Tom Lake - 2023-05-26

    Now I can't use the sample found in the Reference Manual page 675. It says Time-Diff is not numeric. How do I tell it that Z is legal? Is there a printed list of switches I need to set for various parts of COBOL to work? I looked through the manuals and didn't see any reason for Z to not be considered numeric.

     
    • Vincent (Bryan) Coen

      Please advise on the exact section you are referring to as I cannot find
      it, i.e., 11.8.2  etc).

      On 26/05/2023 04:37, Tom Lake wrote:

      Now I can't use the sample found in the Reference Manual page 675. It
      says Time-Diff is not numeric. How do I tell it that Z is legal? Is
      there a printed list of switches I need to set for various parts of
      COBOL to work? I looked through the manuals and didn't see any reason
      for Z to not be considered numeric.

       
      • Tom Lake

        Tom Lake - 2023-05-27

        10.3 Binary Truncation. The program ID is DEMOMATH, It's on page 675 (Adobe Acrobat calls it page 691) as I said.

         
  • Chuck Haatvedt

    Chuck Haatvedt - 2023-05-26

    Tom,

    I thought that PIC ZZ9 is not a numeric field but rather an "edit mask" for displaying a numeric value.

     
    • Tom Lake

      Tom Lake - 2023-05-26

      In the manual, TIME-DIFF (PIC ZZ9.99) is used in a COMPUTE statement so I
      thought it should run that program as-is.
      The period also causes a problem in the PIC although V works.

      -----Original Message-----
      From: discussion@gnucobol.p.re.sourceforge.net
      discussion@gnucobol.p.re.sourceforge.net On Behalf Of Chuck H.
      Sent: Thursday, May 25, 2023 11:54 PM
      To: [gnucobol:discussion] help@discussion.gnucobol.p.re.sourceforge.net
      Subject: [gnucobol:discussion] Now it's PIC Z!

      Tom,

      I thought that PIC ZZ9 is not a numeric field but rather an "edit mask"
      for displaying a numeric value.


      Now it's PIC
      Z!


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/gnucobol/discussion/help/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
    • Tom Lake

      Tom Lake - 2023-05-26

      You're right. It can be the result of a calculation but not used in further
      calculate statements. It's been a while since I programmed in COBOL!
      I am enjoying getting back into it after all these years being away. It'll
      take time to work the rust out of my gears!

      Thanks!

      Tom L

      -----Original Message-----
      From: discussion@gnucobol.p.re.sourceforge.net
      discussion@gnucobol.p.re.sourceforge.net On Behalf Of Chuck H.
      Sent: Thursday, May 25, 2023 11:54 PM
      To: [gnucobol:discussion] help@discussion.gnucobol.p.re.sourceforge.net
      Subject: [gnucobol:discussion] Now it's PIC Z!

      Tom,

      I thought that PIC ZZ9 is not a numeric field but rather an "edit mask"
      for displaying a numeric value.


      Now it's PIC
      Z!


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/gnucobol/discussion/help/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
      👍
      1
  • Vincent (Bryan) Coen

    [vince@applewood tmp]$ uname -a
    Linux applewood.server 5.15.106-server-2.mga8 #1 SMP Thu Apr 6 21:34:51 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
    [vince@applewood tmp]$ cobc -V
    cobc (GnuCOBOL) 3.2-dev.0
    Built Mar 19 2023 19:21:03
    Packaged Mar 08 2023 16:15:11 UTC
    C version "10.4.0"
    [vince@applewood tmp]$ cobc -x test1.cbl
    [vince@applewood tmp]$ ./test1
    USAGE DISPLAY: 1.26 SECONDS
    USAGE COMP: 0.69 SECONDS
    USAGE BINARY: 0.06 SECONDS

    Seems to work ok.

     
    • Tom Lake

      Tom Lake - 2023-05-28

      Yeah. As written it does but I was trying to use the PIC Z field in further calculation. I had forgotten that, while it can be computed, it can't be used in calculations.

       
      • Vincent (Bryan) Coen

        On 28/05/2023 11:25, Tom Lake wrote:

        Yeah. As written it does but I was trying to use the PIC Z field in
        further calculation. I had forgotten that, while it can be computed,
        it can't be used in calculations.

        Using an edited field should NOT be used for computations only as a
        final result field for printing or display.

        Nothing new here this process has been around since 1961 to my personal
        knowledge.

        Yes I am may be older than the average programmer - so sue me :)

         

Anonymous
Anonymous

Add attachments
Cancel