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 

PL1 FETCH

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


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Tue Apr 28, 2009 9:47 am    Post subject: PL1 FETCH Reply with quote

We have a PL1 program that occassionaly hangs, I tracck down "FETCH PROGRAM" being executed multiple times to be the curplit. Here is the screnro:

Code:

MainProg: Procedure Option Main;
  DCL Prog1 ENTRY (FIXED BIN(15));
  .....
  FETCH Prog1;
  CALL Prog1;
 .....
End MainProg;

Prog1: PROC OPTIONS(REENTRANT) REORDER;
  ....
  CALL PROCESS;
  ......
  .......
  PROCESS:PROCREC(A,B,C) OPTIONS(BYVALUE);
    .....
    . .....
    CALL ProgA(X,Y,Z);
    ....
    ....
  End PROCESS;
  ....
  ProgA: PROC(U,V,W) OPTIONS(BYVALUE);
      .....
      DCL PROG99 ENTRY;
      FETCH PROG99;           <-- FETCH PROG99 executed multiple times
      CALL PROG99(W);
      .....
  END PROGA;
END Prog1;

Once I move "FETCH PROG99" (executed 64 times in my test case) out of internal subroutine ProgA to be executed only once (which it supposed to be) in Prog1, then it works fine. From the language manual:
Code:

The FETCH statement checks main storage for the named procedures. Procedures not already in main storage are loaded from the disk.

If FETCH checks and only loads into memory if the program is not already there, why it does matter if "FETCH" is being executed 1000 times?
Back to top
View user's profile Send private message
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