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

Multiple CSECTs in Assembler program


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
quest2008

New User


Joined: 12 Jun 2008
Posts: 22
Location: bangalore

PostPosted: Fri Jun 13, 2008 10:22 am
Reply with quote

Hi,

I have a basic qestion. Could anyone explian what is purpose of declaring multiple CSECT inside a single assembler program, instead of keeping them in separate file.



Thanks
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jun 13, 2008 10:32 am
Reply with quote

Hello quest2008 and welcome to the forums,

Quote:
Could anyone explian what is purpose of declaring multiple CSECT inside a single assembler program
One reason was to reduce the number of modules that had to be managed/distributed. Another was to reduce the number of modules that had to be apf-authorized (if the code needed this).
Back to top
View user's profile Send private message
quest2008

New User


Joined: 12 Jun 2008
Posts: 22
Location: bangalore

PostPosted: Fri Jun 13, 2008 12:51 pm
Reply with quote

Hi Dick,

Thanks a lot.

I have a requirement to combine the CSECTs from different file into single CSECT.
I have some sample code and i am facing SOC4 abend while giving control back to previous CSECT. I have experience in writing programs with single CSECT.

I write the save area logic which is similar to calling another subroutine.

I am not aware what are things i should take care while combing the CSECTs in different file into single CSECT as comparing to calling another CSECT in different library.

(ie giving control to another CSECT, calling CSECT from another CSECT,SAVE area.)
ie giving control to another CSECT, calling CSECT from another CSECT,SAVE area.


MAINPG11 CSECT
***********************************************************************
MAIN1 STM 14,12,12(13)
BALR 12,0
USING *,12
ST 13,SAVE+4
LA 13,SAVE
*
LA 1,PARM01
L 15,SUB
BALR 14,15
LR 4,0
CVD 4,WSDW
UNPK WSCHAR,WSDW
OI WSCHAR+L'WSCHAR-1,X'F0'
MVC MSG+2(L'WSCHAR),WSCHAR
LA 3,MSG
WTO TEXT=(3)
***********************************************************************
EXIT1 L 13,SAVE+4
L 14,12(0,13)
LM 0,12,20(13)
BR 14
DROP 12
***********************************************************************
* STORAGE SECTION
***********************************************************************
SAVE DS 18F
PARM01 DS 0H
DC A(P1)
DC A(P2)
DC A(P3)
P1 DC F'100'
P2 DC F'200'
P3 DC F'210'
WSDW DS D
WSCHAR DS CL8
MSG DC AL2(16)
DS CL16
SUB DC V(SUBPG11)

SUBPG11 CSECT

MAIN2 STM 14,12,12(13)
USING SUBPG11,15
ST 13,SUBSAVE+4
LA 13,SUBSAVE

LR 3,1
LM 4,6,0(3)
L 7,0(,4)
L 8,0(,5)
L 9,0(,6)
AR 7,8
AR 7,9
LR 1,7
L 15,SUB12
BALR 14,15
WTO 'CALL0'
ES EQU *
***********************************************************************
*
***********************************************************************
EXIT2 L 13,SUBSAVE+4
L 14,12(0,13)
LM 1,12,24(13)
BR 14
***********************************************************************
* STORAGE SECTION
***********************************************************************
SUBSAVE DS 18F
WSFW DS F
SUB12 DC V(SUBPG12)

SUBPG12 CSECT

STM 14,12,12(13)
USING SUBPG12,15

LR 3,1
AR 3,3
LR 0,3
L 14,12(0,13)
WTO 'CALL1',ROUTCDE=11
LA 15,0
LM 1,12,24(13)
WTO 'CALL2',ROUTCDE=11
BR 14
WTO 'CALL3',ROUTCDE=11
DROP 15
* LTORG
END MAINPG11




In the spool the 'CALL1' get displayed , so the abend is occuring at this point after L instruction.
Back to top
View user's profile Send private message
quest2008

New User


Joined: 12 Jun 2008
Posts: 22
Location: bangalore

PostPosted: Mon Jun 16, 2008 11:47 am
Reply with quote

Hi,

The above problem mentioned has been solved. This is because of destruction of base address at BALR indtruction. Thanks a lot.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jun 16, 2008 7:08 pm
Reply with quote

Good to hear that it is working.

Thank you for letting us know icon_smile.gif

d
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
Search our Forums:

Back to Top