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
 
Program in acquiring some storage using GETMAIN

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

New User


Joined: 30 Mar 2007
Posts: 21
Location: North Carolina

PostPosted: Fri Jun 13, 2008 2:46 am    Post subject: Program in acquiring some storage using GETMAIN
Reply with quote

Hi,
I have a program in which i am acquiring some storage using GETMAIN. Now we have mapped a dsect to that address.
Code:
ASSM1    CSECT                 
         STM  14,12,12(13)     
         BALR 11,0             
         USING *,11,12         
         LA   12,4095         
         LA   12,1(11,12)     
         GETMAIN RU,LV=2048   
         LR   7,1             
         USING TESTAREA,7     
         ST   13,SAVE+4       
         LA   13,SAVE         
         L    5,=A(BIN1)               
         L    13,SAVE+4                 
         LA    0,2048                   
         FREEMAIN RU,LV=(0),A=(1)       
         LM   14,12,12(13)             
         SR   15,15                     
         BR   14                       
TESTAREA DSECT                         
PACK1    DS   PL3                       
BIN1     DS   F                         
SAVE     DS   18F                       
         END                       


Now this program is not getting compiled. Can anybody lt me know what the reason is. The statement failing is L 5,=A(BIN1)

Thanks,
Ajay
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Fri Jun 13, 2008 5:37 am    Post subject: Re: Program in acquiring some storage using GETMAIN
Reply with quote

What's the Assembly error you're getting for the load instruction of the ADCON?

A load address (LA) of the label BIN into R5 will also work and without generating a 4-Byte literal.

Bill
Back to top
View user's profile Send private message
ajaypmenon

New User


Joined: 30 Mar 2007
Posts: 21
Location: North Carolina

PostPosted: Fri Jun 13, 2008 7:29 am    Post subject: Reply to: Program in acquiring some storage using GETMAIN
Reply with quote

Hi Bill,
THanks a lot for the reply. Lemme tell you what i am doing. I wrote a macro which works as display statement in cobol. To pass the variables we need to send it as =A(BIN1,....) Thats the reason why i did it like that. As you said let me try the option you have suggested tomorrow. Its working properly in using all the cases except the dynamic memory allocation using getmain.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Fri Jun 13, 2008 11:43 am    Post subject: Reply to: Program in acquiring some storage using GETMAIN
Reply with quote

Code:
 L 5,=A(BIN1)


an address constant can be resolved only for an absolute address ( in a CSECT )

BIN1 is defined in a dsect so You get the error
Back to top
View user's profile Send private message
ajaypmenon

New User


Joined: 30 Mar 2007
Posts: 21
Location: North Carolina

PostPosted: Fri Jun 13, 2008 6:21 pm    Post subject: Reply to: Program in acquiring some storage using GETMAIN
Reply with quote

Hi Enrico,
Thanks for the reply. One quick question. It mite be a dumb question also. icon_confused.gif But as per my understanding, Even if use a memory in the CSECT if we check the asssembled code, we can see it as expanded using the base register. That will also be relative address. The time compilation happens we dont know what will be the address of base register. It gets the address only when its loaded to main memory. So why this code is not able to handle this. Please let me know.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Fri Jun 13, 2008 6:37 pm    Post subject: Re: Program in acquiring some storage using GETMAIN
Reply with quote

What Enrico was referring to as an "Absolute Address" means that the label BIN would need to be a constant (IE: A DC as opposed to a DS), based under one of the CSECT Base Registers.

I missed that little "tidbit" too! icon_redface.gif

The Load Address should work as a substitute.

Regards,

Bill
Back to top
View user's profile Send private message
ajaypmenon

New User


Joined: 30 Mar 2007
Posts: 21
Location: North Carolina

PostPosted: Fri Jun 13, 2008 6:46 pm    Post subject: Reply to: Program in acquiring some storage using GETMAIN
Reply with quote

Thanks a lot for the replies.
I think i got it.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Fri Jun 13, 2008 9:44 pm    Post subject: Reply to: Program in acquiring some storage using GETMAIN
Reply with quote

Quote:
What Enrico was referring to as an "Absolute Address" means that the label BIN would need to be a constant (IE: A DC as opposed to a DS), based under one of the CSECT Base Registers.



not necessarily, it can be also a DS as long as its address can be computed as an absolute value...

a csect will be processed by the loader and once loaded will alway reside at the same address
so the addresses can be resolved at load time
a dsect will not be loaded by anybody, so no address computation will ever be carried out
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 sharing PLI storage Pedro PL/I & Assembler 2 Mon Oct 16, 2017 10:11 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Iterative use of a REXX script causin... bryonyh CLIST & REXX 4 Fri Jul 28, 2017 12:52 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm

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