MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Aligned/Unaligned usage for numeric data

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
shashank.sharma
Beginner


Joined: 18 Apr 2007
Posts: 16
Topics: 10

PostPosted: Sat Dec 24, 2011 12:01 am    Post subject: Aligned/Unaligned usage for numeric data Reply with quote

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
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Sat Dec 24, 2011 1:57 am    Post subject: Reply with quote

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
View user's profile Send private message
shashank.sharma
Beginner


Joined: 18 Apr 2007
Posts: 16
Topics: 10

PostPosted: Sat Dec 24, 2011 2:30 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Sat Dec 24, 2011 10:47 am    Post subject: Reply with quote

shashank.sharma,

You need to understand the basics of Data structure alignment

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group