[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [open-cobol-list] Field sizes for COMP.
From: |
Gary Cowell |
Subject: |
Re: [open-cobol-list] Field sizes for COMP. |
Date: |
Fri Aug 26 01:37:40 2005 |
Jim
I don't know what MF options you are compiling with
but I get the following results:
identification division.
program-id. testjm.
data division.
working-storage section.
01.
05 JM1 pic s9(15) comp.
05 JM2 pic 9(10) comp.
05 JM3 pic 9(4) comp.
05 DISPLAY-LEN pic zz9.
procedure division.
a-main section.
move length of JM1 to DISPLAY-LEN
display "s9(15) comp length is "
DISPLAY-LEN
move length of JM2 to DISPLAY-LEN
display "9(10) comp length is "
DISPLAY-LEN
move length of JM3 to DISPLAY-LEN
display "9(4) comp length is "
DISPLAY-LEN
stop run.
MF Server Express:
$ cob -u testjm.cob
$ cobrun ./testjm
s9(15) comp length is 7
9(10) comp length is 5
9(4) comp length is 2
OpenCobol 0.33
$ cobc testjm.cob
$ ./testjm
s9(15) comp length is 8
9(10) comp length is 8
9(4) comp length is 2
But crucially:
$ cobc --std=mf testjm.cob
$ ./testjm
s9(15) comp length is 7
9(10) comp length is 5
9(4) comp length is 2
So --std=mf is what you want in your OpenCobol compile
options.
Gary
--- Jim Morcombe <address@hidden> wrote:
> gl0005.cbl:27: record size too large
> 'GLTRANS-RECORD'
>
> I received this error message when I tried to
> compile a program
> containing a file with a record length of 512
> bytes. I take it that
> the message is not complaining that I have exceeded
> some maximum record
> size, but that the fields in my record add up to
> more than the record
> length specified in my SELECT statement.
>
> If this is the case, then I believe my COMP fields
> are taking up more
> room than under MicroFocus Cobol.
>
> How many characters do COMP fields take up and do I
> have the option of
> changing this by specifying the COMP format?
>
> I want PIC S9(15) COMP to take up 7 bytes, PIC
> 9(10) COMP to take up 5
> bytes and PIC 9(4) COMP to take up 2 bytes.
>
>
>
>
> Jim
>
>
>
>
-------------------------------------------------------
> SF.Net email is Sponsored by the Better Software
> Conference & EXPO
> September 19-22, 2005 * San Francisco, CA *
> Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects
> & Teams * Testing & QA
> Security * Process Improvement & Measurement *
> http://www.sqe.com/bsce5sf
> _______________________________________________
> open-cobol-list mailing list
> address@hidden
>
https://lists.sourceforge.net/lists/listinfo/open-cobol-list
>
___________________________________________________________
How much free photo storage do you get? Store your holiday
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com