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

Program in acquiring some storage using GETMAIN


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Jun 13, 2008 5:37 am
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Jun 13, 2008 11:43 am
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Jun 13, 2008 6:37 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Jun 13, 2008 9:44 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top