Variable with usage COMP in COBOL

后端 未结 2 842
-上瘾入骨i
-上瘾入骨i 2021-01-15 17:49

I am trying to understand how the COBOL variables with COMP Usage clause stores values.

I tried one example as below

    01  VAR14          PIC S9(5)         


        
2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-15 18:30

    COMP usage clause will be called as BINARY or COMPUTATION.

    COMP usage clause applicable to Numeric data type only.

    COMP usage is a binary representation of data.

    The data in COMP variables stored memory in pure binary format.

    The memory allocation for COMP USAGE is like below.

    Picture           Number of Bytes
    S9 to S9(4)       2
    S9(5) to S9(9)    4
    S9(9) to S9(18)   8
    

提交回复
热议问题