Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Comp-3
What is the ASCII equivalent of a field with a PIC of "S9(09)v99
Comp-3"?


Report this thread to moderator Post Follow-up to this message
Old Post
GARY
07-16-06 11:55 PM


Re: Comp-3
GARY wrote:
> What is the ASCII equivalent of a field with a PIC of "S9(09)v99
> Comp-3"?

There isn't one. There's no "ASCII equivalent" of any data definition.
Perhaps you could rephrase?

I can tell you the above PIC defines (usually) six bytes with a decimal
digit in each half-byte and the last half-byte contains the algebraic sign
of the number. i.e., 12 34 56 78 91 2S = 123,456,789.12



Report this thread to moderator Post Follow-up to this message
Old Post
HeyBub
07-16-06 11:55 PM


Re: Comp-3
How many text (ASCII) characters are contained in each of the following
fields?
In the "COMP-3" fields, how are negative numbers (for example,
-00000048612) shown?

PIC X(01)
PIC 9(09)
PIC 9(04)
PIC 9(02)
PIC 9(07)
PIC 9(02)
PIC 9(02)
PIC 9(04)
PIC 9(01)
PIC 9(06)
PIC 9(07)
PIC S9(09)V99       COMP-3
PIC S9(05)V99       COMP-3
PIC S9(02)V99       COMP-3
PIC S9(05)V99       COMP-3
PIC 9(04)
PIC 9(04)
PIC S9(09)            COMP-3
PIC S9(09)V99      COMP-3
PIC S9(03)V99      COMP-3
PIC S9(03)V99      COMP-3
PIC S9(03)V99      COMP-3
PIC S9(09)V99      COMP-3
PIC 9(08)
PIC X(01)
PIC 9(02)
PIC X(02)
PIC S9(07)V99      COMP-3
PIC X(04)
PIC 9(07)
PIC 9(04)
PIC 9(05)
PIC S9(09)V99      COMP-3
PIC S9(09)V99      COMP-3
PIC S9(03)V99      COMP-3
PIC S9(03)V99      COMP-3
PIC S9(07)V99      COMP-3
PIC X(01)
PIC X(02)


Report this thread to moderator Post Follow-up to this message
Old Post
GARY
07-16-06 11:55 PM


Re: Comp-3
What operating system? What compiler? What compiler options specified? and w
hat
do you think the answers are?

--
Bill Klein
wmklein <at> ix.netcom.com
"GARY" <gcotterl@co.riverside.ca.us> wrote in message
news:1153077136.934457.120940@i42g2000cwa.googlegroups.com...
> How many text (ASCII) characters are contained in each of the following
> fields?
> In the "COMP-3" fields, how are negative numbers (for example,
> -00000048612) shown?
>
> PIC X(01)
> PIC 9(09)
> PIC 9(04)
> PIC 9(02)
> PIC 9(07)
> PIC 9(02)
> PIC 9(02)
> PIC 9(04)
> PIC 9(01)
> PIC 9(06)
> PIC 9(07)
> PIC S9(09)V99       COMP-3
> PIC S9(05)V99       COMP-3
> PIC S9(02)V99       COMP-3
> PIC S9(05)V99       COMP-3
> PIC 9(04)
> PIC 9(04)
> PIC S9(09)            COMP-3
> PIC S9(09)V99      COMP-3
> PIC S9(03)V99      COMP-3
> PIC S9(03)V99      COMP-3
> PIC S9(03)V99      COMP-3
> PIC S9(09)V99      COMP-3
> PIC 9(08)
> PIC X(01)
> PIC 9(02)
> PIC X(02)
> PIC S9(07)V99      COMP-3
> PIC X(04)
> PIC 9(07)
> PIC 9(04)
> PIC 9(05)
> PIC S9(09)V99      COMP-3
> PIC S9(09)V99      COMP-3
> PIC S9(03)V99      COMP-3
> PIC S9(03)V99      COMP-3
> PIC S9(07)V99      COMP-3
> PIC X(01)
> PIC X(02)
>



Report this thread to moderator Post Follow-up to this message
Old Post
William M. Klein
07-16-06 11:55 PM


Re: Comp-3
My "guess" is:

PIC X(01)                                   1
PIC 9(09)                                   9
PIC 9(04)                                   4
PIC 9(02)                                   2
PIC 9(07)                                   7
PIC 9(02)                                   2
PIC 9(02)                                   2
PIC 9(04)                                   4
PIC 9(01)                                   1
PIC 9(06)                                   6
PIC 9(07)                                   7
PIC S9(09)V99 COMP-3                      11
PIC S9(05)V99 COMP-3                       7
PIC S9(02)V99 COMP-3                       4
PIC S9(05)V99 COMP-3                       7
PIC 9(04)                                 4
PIC 9(04)                                 4
PIC S9(09) COMP-3                        9
PIC S9(09)V99 COMP-3                     11
PIC S9(03)V99 COMP-3                       5
PIC S9(03)V99 COMP-3                       5
PIC S9(03)V99 COMP-3                       5
PIC S9(09)V99 COMP-3                     11
PIC 9(08)                                   8
PIC X(01)                                   1
PIC 9(02)                                   2
PIC X(02)                                   2
PIC S9(07)V99 COMP-3                       9
PIC X(04)                                   4
PIC 9(07)                                   7
PIC 9(04)                                   4
PIC 9(05)                                   5
PIC S9(09)V99 COMP-3                     11
PIC S9(09)V99 COMP-3                     11
PIC S9(03)V99 COMP-3                       5
PIC S9(03)V99 COMP-3                       5
PIC S9(07)V99 COMP-3                       9
PIC X(01)                                    1
PIC X(02)                                    2



Note: The "Comp-8" LRECL = 160; the LRECL of my "guess" = 214


Report this thread to moderator Post Follow-up to this message
Old Post
GARY
07-16-06 11:55 PM


Re: Comp-3
GARY wrote:
> How many text (ASCII) characters are contained in each of the following
> fields?

It may be 'none' if this is on an EDCIDC machine.  Fields need not be
represented as ASCII characters, for example binary or packed decimal
are bit patterns which need to be examined as bits or hexadecimal
nibbles. COMP-3 may be packed decimal* and thus each digit is a nibble
(4 bits - half byte).

> In the "COMP-3" fields, how are negative numbers (for example,
> -00000048612) shown?

Sign is probably in last in last nibble.



* COMP-3 can be anything the compiler writer wants it to be. You need
to specify the compiler and possibly the system it is used on.  In many
cases COMP-3 is packed decimal with the sign in the last nibble.


Report this thread to moderator Post Follow-up to this message
Old Post
Richard
07-16-06 11:55 PM


Re: Comp-3
(On an IBM mainframe - and many - not all - other platforms)

PIC S9(09)V99 COMP-3                      11

takes 6 bytes AS DOES

PIC S9(08)V99 COMP-3

Can you figure out why?

There is NOTHING about any of this that has to do with "ASCII CHARACTERS" - 
but
it does have to do with "information contained" (10 or 11 digits and a sign)
 and
how many bytes it takes to store it.

--
Bill Klein
wmklein <at> ix.netcom.com
"GARY" <gcotterl@co.riverside.ca.us> wrote in message
news:1153080213.610225.323410@p79g2000cwp.googlegroups.com...
>                                          My "guess" is:
>
> PIC X(01)                                   1
> PIC 9(09)                                   9
> PIC 9(04)                                   4
> PIC 9(02)                                   2
> PIC 9(07)                                   7
> PIC 9(02)                                   2
> PIC 9(02)                                   2
> PIC 9(04)                                   4
> PIC 9(01)                                   1
> PIC 9(06)                                   6
> PIC 9(07)                                   7
> PIC S9(09)V99 COMP-3                      11
> PIC S9(05)V99 COMP-3                       7
> PIC S9(02)V99 COMP-3                       4
> PIC S9(05)V99 COMP-3                       7
> PIC 9(04)                                 4
> PIC 9(04)                                 4
> PIC S9(09) COMP-3                        9
> PIC S9(09)V99 COMP-3                     11
> PIC S9(03)V99 COMP-3                       5
> PIC S9(03)V99 COMP-3                       5
> PIC S9(03)V99 COMP-3                       5
> PIC S9(09)V99 COMP-3                     11
> PIC 9(08)                                   8
> PIC X(01)                                   1
> PIC 9(02)                                   2
> PIC X(02)                                   2
> PIC S9(07)V99 COMP-3                       9
> PIC X(04)                                   4
> PIC 9(07)                                   7
> PIC 9(04)                                   4
> PIC 9(05)                                   5
> PIC S9(09)V99 COMP-3                     11
> PIC S9(09)V99 COMP-3                     11
> PIC S9(03)V99 COMP-3                       5
> PIC S9(03)V99 COMP-3                       5
> PIC S9(07)V99 COMP-3                       9
> PIC X(01)                                    1
> PIC X(02)                                    2
>
>
>
> Note: The "Comp-8" LRECL = 160; the LRECL of my "guess" = 214
>



Report this thread to moderator Post Follow-up to this message
Old Post
William M. Klein
07-16-06 11:55 PM


Re: Comp-3
On 16 Jul 2006 10:37:35 -0700, "GARY" <gcotterl@co.riverside.ca.us>
wrote:

>What is the ASCII equivalent of a field with a PIC of "S9(09)v99
>Comp-3"?

Your question doesn't make any sense.

Report this thread to moderator Post Follow-up to this message
Old Post
Howard Brazee
07-17-06 12:55 PM


Re: Comp-3
GARY wrote:
> How many text (ASCII) characters are contained in each of the
> following fields?

None. ASCII has nothing to do with it.

> In the "COMP-3" fields, how are negative numbers (for example,
> -00000048612) shown?

A hex F, A, C, or E in the last nibble indicates a positive number, D and B
indicate negative.

>
> PIC X(01)
> PIC 9(09)
> PIC 9(04)
> PIC 9(02)
> PIC 9(07)
> PIC 9(02)
> PIC 9(02)
> PIC 9(04)
> PIC 9(01)
> PIC 9(06)
> PIC 9(07)
> PIC S9(09)V99       COMP-3
> PIC S9(05)V99       COMP-3
> PIC S9(02)V99       COMP-3
> PIC S9(05)V99       COMP-3
> PIC 9(04)
> PIC 9(04)
> PIC S9(09)            COMP-3
> PIC S9(09)V99      COMP-3
> PIC S9(03)V99      COMP-3
> PIC S9(03)V99      COMP-3
> PIC S9(03)V99      COMP-3
> PIC S9(09)V99      COMP-3
> PIC 9(08)
> PIC X(01)
> PIC 9(02)
> PIC X(02)
> PIC S9(07)V99      COMP-3
> PIC X(04)
> PIC 9(07)
> PIC 9(04)
> PIC 9(05)
> PIC S9(09)V99      COMP-3
> PIC S9(09)V99      COMP-3
> PIC S9(03)V99      COMP-3
> PIC S9(03)V99      COMP-3
> PIC S9(07)V99      COMP-3
> PIC X(01)
> PIC X(02)



Report this thread to moderator Post Follow-up to this message
Old Post
HeyBub
07-17-06 12:55 PM


Re: Comp-3
"GARY" <gcotterl@co.riverside.ca.us> wrote in message
news:1153077136.934457.120940@i42g2000cwa.googlegroups.com...
> How many text (ASCII) characters are contained in each of the following
> fields?
> In the "COMP-3" fields, how are negative numbers (for example,
> -00000048612) shown?
>
> PIC X(01)
> PIC 9(09)
> PIC 9(04)
> PIC 9(02)
> PIC 9(07)
> PIC 9(02)
> PIC 9(02)
> PIC 9(04)
> PIC 9(01)
> PIC 9(06)
> PIC 9(07)
> PIC S9(09)V99       COMP-3
> PIC S9(05)V99       COMP-3
> PIC S9(02)V99       COMP-3
> PIC S9(05)V99       COMP-3
> PIC 9(04)
> PIC 9(04)
> PIC S9(09)            COMP-3
> PIC S9(09)V99      COMP-3
> PIC S9(03)V99      COMP-3
> PIC S9(03)V99      COMP-3
> PIC S9(03)V99      COMP-3
> PIC S9(09)V99      COMP-3
> PIC 9(08)
> PIC X(01)
> PIC 9(02)
> PIC X(02)
> PIC S9(07)V99      COMP-3
> PIC X(04)
> PIC 9(07)
> PIC 9(04)
> PIC 9(05)
> PIC S9(09)V99      COMP-3
> PIC S9(09)V99      COMP-3
> PIC S9(03)V99      COMP-3
> PIC S9(03)V99      COMP-3
> PIC S9(07)V99      COMP-3
> PIC X(01)
> PIC X(02)
>

How about DISPLAYing LENGTH OF



Report this thread to moderator Post Follow-up to this message
Old Post
charles hottel
07-18-06 02:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:06 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.