View previous topic :: View next topic |
Author |
Message |
shashank.sharma Beginner
Joined: 18 Apr 2007 Posts: 16 Topics: 10
|
Posted: Sat Dec 24, 2011 12:01 am Post subject: Aligned/Unaligned usage for numeric data |
|
|
I get the same output with the 3 WRITE statements.
Code: | DCL 1 A00,
2 A,
3 A1 CHAR (78) INIT ((78)' '),
3 A2 FIXED BIN (12);
A2 = 33;
WRITE FILE (OUTFILE) FROM (A00);
DCL 1 B00,
2 B,
3 B1 CHAR (78) INIT ((78)' '),
3 B2 FIXED BIN (12) ALIGNED;
B2 = 33;
WRITE FILE (OUTFILE) FROM (B00);
DCL 1 C00,
2 C,
3 C1 CHAR (78) INIT ((78)' '),
3 C2 FIXED BIN (12) UNALIGNED;
C2 = 33;
WRITE FILE (OUTFILE) FROM (C00);
|
Is there any effect of ALIGNED/UNALIGNED on numeric data? |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Sat Dec 24, 2011 1:57 am Post subject: |
|
|
What does the manual say? Sorry, but I am too lazy on Christmas Eve to go and look it up. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
shashank.sharma Beginner
Joined: 18 Apr 2007 Posts: 16 Topics: 10
|
Posted: Sat Dec 24, 2011 2:30 am Post subject: |
|
|
The manual says:
ALIGNED specifies that the data element is aligned on the storage boundary corresponding to its data-type requirement. UNALIGNED specifies that each data element is mapped on the next byte boundary, except for fixed-length bit strings, which are mapped on the next bit.
Don't understand what they want to say in the first line. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Sat Dec 24, 2011 10:47 am Post subject: |
|
|
shashank.sharma,
You need to understand the basics of Data structure alignment
Kolusu |
|
Back to top |
|
|
|
|