IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

'STATIC UNALIGNED' in PLI code


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
clarkzx

New User


Joined: 04 Jun 2008
Posts: 7
Location: Rochester

PostPosted: Thu Mar 19, 2009 2:12 pm
Reply with quote

Dears,

I got some PLI code like:
Code:
DCL 1 LDGRTRX_REC STATIC UNALIGNED,
  % INCLUDE(APTEMGNC);             

Can anybody explain the usage of ' STATIC UNALIGNED '?
Thank you very much.
Back to top
View user's profile Send private message
senthilnathanj

New User


Joined: 31 Jul 2007
Posts: 47
Location: chennai

PostPosted: Thu Mar 19, 2009 2:36 pm
Reply with quote

Hi,
STATIC is the default storage class for External scope variables. However, STATIC variables can have either Internal or External scope.

For internal variables declared with STATIC storage class, storage is
allocated by the compiler in the Static Internal Control Section for its
compiled procedure. Thus, the storage is pre-allocated and resides
in the program load module (unless it is in a dynamically fetched procedure).

For external variables declared with STATIC storage class, storage is
resolved by the linkage editor and resides as a control section under its
own name in the program load module.

In either case, the storage is considered to have been allocated prior to
execution time and cannot be freed until the program terminates ( or, in the case of a dynamic procedure, until it is released). The programmer has no control over the allocation and freeing of STATIC storage.

STATIC storage is most commonly used in repetitively invoked procedures
for locally declared variables when the value of an identifier will never change the value of an identifier needs to be retained for the next invocation.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Mar 19, 2009 5:55 pm
Reply with quote

UNALIGNED is used to avoid 'padding' bytes. In an ALIGNED structure, the compiler will add bytes if needed to align, say, a BINARY FIXED(15) field on a half-word boundary. Typically, you wouldn't want this in an I/O input structure.

Garry.
Back to top
View user's profile Send private message
clarkzx

New User


Joined: 04 Jun 2008
Posts: 7
Location: Rochester

PostPosted: Sun Mar 22, 2009 6:49 pm
Reply with quote

Thank you very much to all
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Monitoring production job progress. N... JCL & VSAM 4
Search our Forums:

Back to Top