View previous topic :: View next topic |
Author |
Message |
jlmori Beginner
Joined: 20 Jun 2003 Posts: 9 Topics: 1
|
Posted: Fri Jun 20, 2003 11:51 pm Post subject: length in bytes of PIC S9(9) COMP. |
|
|
To MVS Help
Could you please tell me how many bytes a cobol field of PIC S9(9) COMP is ?
It currently defines a data item in a sequential file on the OS 390 mainframe which is four bytes in length.
Could you please confirm that it is 4 bytes in length (without a C at the end to signify a positive sign).
Thanks
Justin Morieson |
|
Back to top |
|
|
Glenn Beginner
Joined: 23 Mar 2003 Posts: 56 Topics: 3
|
Posted: Sat Jun 21, 2003 1:57 am Post subject: |
|
|
You have your answer if it occupied 4 bytes in your file. |
|
Back to top |
|
|
jlmori Beginner
Joined: 20 Jun 2003 Posts: 9 Topics: 1
|
Posted: Sat Jun 21, 2003 2:47 am Post subject: |
|
|
Thanks
I understand it is 4 bytes in length. However, why is it that the sign is represented in a field defined as PIC S9(9) COMP-3 (packed decimal- 5 bytes in length) and not in a PIC S9(9) COMP ? It seems meaningless to have the 'S' in the PIC clause.
Thanks
Justin |
|
Back to top |
|
|
jlmori Beginner
Joined: 20 Jun 2003 Posts: 9 Topics: 1
|
Posted: Sat Jun 21, 2003 5:31 am Post subject: |
|
|
To MVS Forums
Please ignore my last message. After doing further research on MVS Forums cobol links I have found out that a COMP field is actually Binary. Therefore the 'S' in the PIC S9(9) COMP does have internal meaning as the data is stored as either a positive or negative value and is represented as four bytes. The decimal value is not the literal HEX values as in a PACKED-DECIMAL field eg X'000012345C' (stored as PIC S9(9) COMP-3) would represent the decimal number +12345. The number X'00123456' stored as Binary (PIC S9(9) COMP) would compute to a decimal equivalent of +1193046. Similarly a decimal value of -797 stored in a PIC S9(9) COMP would be represented in HEX as 'FFFFFCE3'. These conversions can be done using a Scientific calculator.
Thanks
Justin |
|
Back to top |
|
|
slade Intermediate
Joined: 07 Feb 2003 Posts: 266 Topics: 1 Location: Edison, NJ USA
|
Posted: Sat Jun 28, 2003 10:17 pm Post subject: |
|
|
Hi Justin,
It looks like you learned 2 lessons by posting here:
1) You get answers to the question you post. So it behooves one to take care in phrasing the question.
2) The glories of research. Sometimes referred to as RTFM.
Regards, Jack. |
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Sun Jun 29, 2003 9:32 am Post subject: |
|
|
Justin,
For more information about COBOL data types and DFSORT formats, see the "What are the equivalent DFSORT formats for various COBOL data types?" Ask Professor Sort item at:
http://www.ibm.com/servers/storage/support/software/sort/mvs/professor_sort/ _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Last edited by Frank Yaeger on Fri Aug 25, 2006 5:56 pm; edited 1 time in total |
|
Back to top |
|
|
jlmori Beginner
Joined: 20 Jun 2003 Posts: 9 Topics: 1
|
Posted: Mon Jul 07, 2003 6:29 am Post subject: |
|
|
Thanks
I have had a brief look at this link- very interesting.
What does the 'FI' format stand for ?
Justin |
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Mon Jul 07, 2003 9:59 am Post subject: |
|
|
Justin,
FI is signed fixed point. Negative numbers are in 2's complement form. For example - 2-byte FI: +1 is X'0001' and -1 is X'FFFF'.
For details on all of DFSORT's formats, see Appendix C of "DFSORT Application Programming Guide". You can get to it in the PDF version from:
http://www-1.ibm.com/servers/eserver/zseries/zos/bkserv/r2pdf/dfsort.html _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
|
|
|