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
 

 

How to keep data above or below the line?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
dinesh_mf

New User


Joined: 26 May 2005
Posts: 15
Location: maharashtra

PostPosted: Thu Aug 04, 2005 8:25 pm    Post subject: How to keep data above or below the line?
Reply with quote

Hello Everybody,
As I remember I have seen placing the control blocks below or above the line in assembler programs. DCB always lies below the line but we can keep it above the line I think with the help of keyword MODE=31.

How do you we switch the common working storage in the program above or below the line as we do in COBOL programs by using the compiler option DATA(24) DATA(31)? Please let me know or atleast point me to the reference document.

All suggestions are welcome...


Regard,
dinesh Thakur
Back to top
View user's profile Send private message

ironmike

New User


Joined: 07 Aug 2005
Posts: 33

PostPosted: Sun Aug 07, 2005 6:07 am    Post subject:
Reply with quote

In Assembler on a z/OS system, the location of virtual storage obtained by a user program is determined by the keywords used or defaulted on the GETMAIN or STORAGE macro. LOC=31 or LOC=24 indicates a request for storage above the 31-bit address line or below it.

The GETMAIN or STORAGE macro call in your program that actually obtains the program work area controls where the work area is actually allocated, above the line or below it.

Common storage work areas are usually obtained shortly after entry to the user program. Find the GETMAIN or STORAGE macro call that obtains the common work area, then change the macro to use LOC=24 or LOC=31 as appropriate.

The program MUST be link edited (using the linkage editor or binder) with AMODE=31 in order to successfully use LOC=31 on the GETMAIN or STORAGE macro.
Back to top
View user's profile Send private message
dinesh_mf

New User


Joined: 26 May 2005
Posts: 15
Location: maharashtra

PostPosted: Mon Aug 08, 2005 9:40 pm    Post subject: Re: How to keep data above or below the line?
Reply with quote

Thank you very much Ironmike. I will further look into the details of the macro....

I am having a query. I dont know whether it is logical or not.. Say I have coded a program as following..

MAINPGM CSECT
STM 14,12,12(13)
BALR *,12
ST
LA 13,SAVE+4
.
.
.
.
.

BR 14

A DC
B DC
C DC

etc..

While executing the program in AMODE 31, Where does the data A,B and C lie ( below or above the line) and how to switch it dynamically from below to above. Say it is lying below the line , how to switch it to above the line dynamically?

Can we issue Getmain for this ?

This question may be weird for you. I also haven't seen a code since a long time. Basically I am not a assembler programmer but having interest in it.

Thank you very much,
Dinesh
Back to top
View user's profile Send private message
ironmike

New User


Joined: 07 Aug 2005
Posts: 33

PostPosted: Mon Aug 08, 2005 10:27 pm    Post subject:
Reply with quote

A, B, and C are labels you assigned to storage areas defined with the DC instruction, and as you have coded your sample program, they are included inside of your Assembler program itself. Where they reside (above the 31 bit address line or below it) depends therefore upon where your program itself resides. If your program resides in virtual storage above the 31 bit address line, then areas labeled A, B, and C reside there also. If your program resides below the line, then the storage areas labeled A, B, and C do also since they are part of your program.

Program residency is controlled by one thing: the RMODE used when the program is link edited via the linkage editor or binder. RMODE=ANY tells z/OS to load the module anywhere, either above or below the 31 bit address line. RMODE=24 says load it BELOW the 31 bit address line. There is no RMODE=31, but RMODE=ANY almost always (99.9999% of the time) causes your program to load ABOVE the 31 bit address line.

If your program resides above the 31 bit address line, then you must code for that residency state by ensuring that your code treats all addresses as 31-bit addresses, not 24-bit addresses.

Now, the only way to move storage areas A, B, and C above the 31 bit address line (or below said line) is to use the GETMAIN or STORAGE macro to dynamically obtain virtual storage LOC=31 or LOC=24 and then move the A, B or C contants to that area.

Usually, it's best to define contants that don't change (DC instruction) in your program, and variables that do change (DS instruction) in a DSECT, then use GETMAIN (or STORAGE, same thing) to obtain an area either above or below the 31 bit address line and load the address of the gotten area into the base register assigned to that DSECT via a USING instruction.
Back to top
View user's profile Send private message
dinesh_mf

New User


Joined: 26 May 2005
Posts: 15
Location: maharashtra

PostPosted: Tue Aug 09, 2005 1:13 pm    Post subject: Re: How to keep data above or below the line?
Reply with quote

Ironmike,
Thanks a lot for your help. I learned a lot from you. Hope you will continue doing it.

Regards,

Dinesh
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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am


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