MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

entry points

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
Disco_Stu
Beginner


Joined: 04 Feb 2003
Posts: 19
Topics: 7

PostPosted: Tue Feb 04, 2003 2:07 pm    Post subject: entry points Reply with quote

I am currently reworking a program which uses entry points. I'm not too knowledgable in the area.

I have a called program. The first entry point(M7476620) opens the output file. Calls to the next entry point (M7476631) write to the previously opened file.

I enter at the first point, and everything is ok. Later, my call enters at the second point and I get a SOC4. I am thinking that at this point the output file has been closed? Something to do with the GOBACK?

Here is the code:
Code:

0-OPEN.                                                     
    ENTRY 'M7476620'.                                       
    SKIP1                                                   
    DISPLAY '*** VALID WRITE MODUEL - M7476620 - CALLED - ' 
            'LAST UPDATED DEC 16, 1976 - SMF *** '.         
    OPEN OUTPUT VALFILE.                                     
    GOBACK.                                                 
    SKIP3 

1-MAINSTREAM.                                       
    ENTRY 'M7476631'    USING VALID-EXTRACT-RECORD. 
    DISPLAY 'M7476631 CALLED'.                       
    SKIP1                                           
1-WRITE-VALID-REC.                                   
    WRITE VALID-RECORD   FROM VALID-EXTRACT-RECORD. 
    GOBACK.                                         
    SKIP3
Back to top
View user's profile Send private message
Disco_Stu
Beginner


Joined: 04 Feb 2003
Posts: 19
Topics: 7

PostPosted: Tue Feb 04, 2003 2:20 pm    Post subject: Reply with quote

also, not sure if it matters, but i'm making the calls to the entry points dynamically.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Tue Feb 04, 2003 2:35 pm    Post subject: Reply with quote

Disco_stu,

Static calls to alternate entry points work without restriction.Dynamic calls to alternate entry points require:

  • NAME or ALIAS linkage editor control statements.
  • The NAME compiler option.
  • An intervening CANCEL for dynamic calls to the same program at differing entry points.

Be aware that the CANCEL will cause the program to be invoked in initial state when it is called at a new entry point.

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Disco_Stu
Beginner


Joined: 04 Feb 2003
Posts: 19
Topics: 7

PostPosted: Tue Feb 04, 2003 4:04 pm    Post subject: Reply with quote

Ok, so the CANCEL is necessary. But this will close my output file in my called program, right? So the second time i go into the called program and try to write, the output file is closed. Hence, S0C4.

I took out the CANCEL statment (just for fun) and it seems like the same thing is happening. Without the CANCEL statement I would assume the called program would stay in its last-used state. Iis the called program still returning to its initial state?
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Tue Feb 04, 2003 5:16 pm    Post subject: Reply with quote

Disco_Stu, Are you the only one to have used this module since 1976? Has no-one in your shop any experience here?

Cheers,
Merv
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
nxn00
Beginner


Joined: 02 Dec 2002
Posts: 18
Topics: 0
Location: US

PostPosted: Tue Feb 04, 2003 5:58 pm    Post subject: Reply with quote

I just tried to post a reply but it didn't appear.

Advice is to use a static call.

We had the same problem at work this week with a program that was compiled DYNAM and tried to call an entry point in another program. Changing compie option to NODYNAM solved the problem.
_________________
Natalie
Back to top
View user's profile Send private message Send e-mail
DaveyC
Moderator


Joined: 02 Dec 2002
Posts: 151
Topics: 3
Location: Perth, Western Australia

PostPosted: Wed Feb 05, 2003 12:30 am    Post subject: Reply with quote

Sounds like you need a DLL, can you write them in OO COBOL ? I agree with Natalie, make it a static call.
_________________
Dave Crayford
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group