HP OpenVMS Systems

ask the wizard
Content starts here

RMS Index File Keys, FDL, Strings and Numerics?

» close window

The Question is:

I am using alpha open vms ver 6.1.  I have a signed numeric field that is a key
 field in a file.  I have tried to create a FDL for the file, but it is saying
 that it is a string in the type.  This needs to be defined as signed numeric.
 What is the type f
or this.

The Answer is :

    > I have a signed numeric field that is a key field in a file.
    From what perspective is it a signed numeric field?
    When it comes down to the bits in memory, what does it look like?
    For example in COBOL a field declared just as S9999 may be called
    signed number but in memory, and for RMS, is is just a piece of
    string which happens to have a restricted series of characters (0 - 9)
    Now if you add a COMP clause to that cobol, you can turn the bit-
    pattern into PACKED DECIMAL or a BINARY INTEGER. For those RMS has
    corresponding defintions see the KEY TYPE table in section 4.8 in
    the RMS Utilities Manual:
    For example the entry for INT4 reads: "A signed, 4-byte integer; this data
    type can represent integers between --2,147,483,648 and+2,147,483,647. "
    Defining it as string may well be correct, even though you know that
    string itself contains just numbers... rms does not need to know that.

answer written or last revised on ( 13-JUN-2003 )

» close window