Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

'STATIC UNALIGNED' in PLI code

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: 'STATIC UNALIGNED' in PLI code
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    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 994
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Mar 19, 2009 5:55 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us