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
 

 

Multiple CSECTs in Assembler program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: Multiple CSECTs in Assembler program
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

Site Director


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

PostPosted: Fri Jun 13, 2008 10:32 am    Post subject:
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    Post subject: Reply to: Multiple CSECTs in Assembler program
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    Post subject: Reply to: Multiple CSECTs in Assembler program
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

Site Director


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

PostPosted: Mon Jun 16, 2008 7:08 pm    Post subject: Reply to: Multiple CSECTs in Assembler program
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    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 Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 6 Fri Mar 24, 2017 2:24 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm


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