Re: COBOL format definitions?
- From: Donald Tees <donald_tees@xxxxxxxxxxxxxx>
- Date: Fri, 29 Dec 2006 15:00:45 -0500
Barb wrote:
Hi all,Comp fields of all sorts are platform dependent, so to give you information, we need more. Usually they are word oriented fields, or BCD nibble oriented fields.
I'm not a COBOL programmer at all, but I am starting to work with data
that was given to me with a COBOL field format listing. I get most of
the format codes, but there are a few that I need to verify that I'm
understanding them correctly.
For example, I understand that PIC X(03) is an alpha/numeric field with
a length of 3 characters.
I also understand that PIC 9(03) is a numeric integer field with
numbers <= 999.
But I would like to find some sort of online listing or guide to help
me as I encounter other ones such as:
* PIC S9(09) COMP-3
* * PIC S9(07)V99 COMP-3
I don't need to program an import file (I know that SAS can convert a
COBOL copybook to a SAS informat), but I would like to sound half-way
intellegent with the people who provided the copybook when I have
questions about the files.
Can anyone point me to a good website that just explains the basics of
what these codes mean (there are others besides the 3 above that I
would like to be able to interpret).
Thanks for any help you can provide!
Barb
The PIC 9(02)V9(04) fields and the numeric fields without the "V" are always byte oriented numeric, with leading decimals. The V is an implied decimal, so 123456 in a 9(02)V9(04) field is 12.3456, and 000123 is 0.01234, for example.
Most other characters in picture clauses are only used for editing, and are not usually used for storing data. For example, a picture zz9.999
is a 6 digit plus actual decimal(a dot) with the decimal after the first three digits, and zero supression on the first two digits. The field would be 7 characters long. As a general rule, Cobol fields are fixed length.
That should give you a start, anyway. Once you provide a platform and compiler for the source of the data, someone should be able to give you a hand on the comp fields.
Donald
.
- References:
- COBOL format definitions?
- From: Barb
- COBOL format definitions?
- Prev by Date: Re: COBOL format definitions?
- Next by Date: Re: Productivity
- Previous by thread: Re: COBOL format definitions?
- Next by thread: Re: COBOL format definitions?
- Index(es):