Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 995
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
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts I want to retire TRX and use only Rex... Abhinav Sharma CLIST & REXX 6 Sat Jul 29, 2017 2:53 am
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us