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

Heed help with TPNS using STL and using user exits


IBM Mainframe Forums -> IBM Tools
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
kpoxa

New User


Joined: 22 Jun 2006
Posts: 2

PostPosted: Thu Jun 22, 2006 4:48 pm
Reply with quote

I have the next STL

Code:

constant handle_sa#    '240'                                       
constant data_sa#      '241'                                       
constant rc_counter#   'DC101'                                     
                                                                   
constant rc_eof        2                                           
                                                                   
allocate file_handle handle_sa#                                     
allocate file_data   data_sa#                                       
allocate file_rc     rc_counter#                                   
                                                                   
TEST : msgtxt                                                       
                                                                   
say 'Hello from the TPNS simulation'                               
say 'The constants are:' handle_sa# data_sa# rc_counter#           
                                                                   
file_data = 'HLQ.TPNS.DATA'                                     
file_rc   = 999                                                     
                                                                   
userexit('ITPFIOX', 'OPENI' rc_counter# handle_sa# data_sa#)       
if file_rc <> 0 then say 'file error =' char(file_rc)               
else                 say 'File' file_data 'opened. rc='char(file_rc)
                                                                   
do forever                           
                                                               
    userexit('ITPFIOX', 'READ' rc_counter# handle_sa# data_sa#) 
    if file_rc <> 0 then do                                     
        say 'file error =' char(file_rc)                           
        leave                                                     
    end                                                         
    else                                                         
        say 'Read from file:' substr(file_data,1,40)               
end                                                           
                                                               
if file_rc <> rc_eof then say 'Invalid operation' char(file_rc)
else                      say 'EOF reached, rc='char(file_rc) 
                                                               
userexit('ITPFIOX', 'CLOSE' rc_counter# handle_sa# )           
if file_rc <> 0 then say 'file error =' char(file_rc)         
else                 say 'File closed, rc='char(file_rc)       
                                                     
opcmnd ('ZEND')                                               
say 'ZEND sended'                                             
opcmnd ('P')                                                   
                                                               
endtxt                                                               


end I run this simulation (after translation to MSG DECK) with next JCL

Code:

//MYIDTPNS  JOB (5610),'TPNS',MSGCLASS=R,                             
//         CLASS=Y,NOTIFY=&SYSUID,REGION=0M,PRTY=10                 
//*                                                                 
// V NET,ID=MYTPNS,ACT                                             
//*                                                                 
// SET TPNSBASE='TPNS.LOAD'                                         
// SET HLQ='MYUID.TPNS'                                             
// SET MONID=MYMON                                                 
// SET NETID=MYTEST                                                 
// SET LOG='DSN=MYUID.TPNS.LOG(MYLOG),DISP=SHR'                     
// SET SYSP='DSN=MYUID.TPNS.LOG(PRINT),DISP=SHR'                   
//*SET LOG='SYSOUT=*'                                               
//*                                                                 
//* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//*         T P N S    S D S F    S C R I P T                       -
//* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//*                                                                 
//ISPF     EXEC PGM=ITPENTER,TIME=1440,PERFORM=20,DPRTY=(15,15),     
//            PARM='DMAPPL=&MONID,NTWRKL=&NETID'                     
//STEPLIB  DD DSN=&TPNSBASE,DISP=SHR                                 
//SYSPRINT DD &SYSP                                                 
//SYSABEND DD SYSOUT=*                                               
//SYSUDUMP DD SYSOUT=*                                               
//SYSUT2   DD SPACE=(CYL,(1,1,10)),UNIT=SYSDA                       
//SYSUT3   DD SPACE=(CYL,(1,1,10)),UNIT=SYSDA                       
//MSGDISK  DD UNIT=SYSDA,SPACE=(4096,100)                           
//INITDD   DD DSN=&HLQ..INIT,DISP=SHR                               
//MSGDD    DD DSN=&HLQ..MSG,DISP=SHR                                 
//LOGDD    DD &LOG                                                   


The problems

1. The simulation performs all operations, file opens, reed operations finishes with code 0 and finally file is closed. But TPNS not finishes its work, JCL stacks on the step ISPF (see in JCL).

2. without using of opcmnd ('ZEND') MSG deck not finishes the simulation and without opcmnd ('P') TPNS takes an all output produced by the simulation and repeats it infinite times (this fills the SYS log and I receive compliment from the operators). I don't know if actually TPNS sends the same output or it rerun the same DECK again and again
(until I cancel job in SDSF).

The question: where is the problem , in my STL or some were else and how I can track this issue.
Back to top
View user's profile Send private message
kpoxa

New User


Joined: 22 Jun 2006
Posts: 2

PostPosted: Thu Jun 22, 2006 5:21 pm
Reply with quote

By the way, I'm not wrote this, but, if I remove from this STL all calls to userexit, the simulation finishes successful and TPNS also finishes without repeating of output and immediately. I think the problem is some how related to such userexit's.
Back to top
View user's profile Send private message
Bruce Johnson

New User


Joined: 02 Jan 2012
Posts: 1
Location: New Zealand

PostPosted: Tue Apr 10, 2012 10:46 am
Reply with quote

I am guessing you have a NTWRK definition with PATH statements that
define TEST as the only msgtxt. If so then tpns will continue to attempt to
re-execute this deck. You must build in some scripting logic to stop execution.
In this case you have found that Zend and P will stop execution.
ZEND command causes an orderly shutdown of the tpns system and writes the message log buffers to the log data set and causes the job to end.
P command causes tpns to stop activity on the resource specified, in this case it will default to stopping the NTWRK, but because you have already ended tpns with Zend the P is not needed.

You may care to investigate the Quiesce command in STL. Also the Release command.

If you still need help let me know.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Apr 10, 2012 11:02 am
Reply with quote

The topic has been resurrected after
Code:
...          5 year(s) - (months difference / 12 )
...          6 year(s) - (difference )
...         70 months
...       2118 days
...      50849 hours
...    3050965 minutes
...  183057900 seconds

it would be odd that a reply ( even if a correct one ) would still be useful after such a long time

since these are the only posts from the TS ( topic starter ) it is reasonable to infer that heshe just diappeared.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Tue Apr 10, 2012 4:04 pm
Reply with quote

Opening long forgotten topics is very easy to prevent, just lock anything older than three months, like I do on FanDeZhi.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> IBM Tools

 


Similar Topics
Topic Forum Replies
No new posts PuTTY - "User is not a surrogate... IBM Tools 5
No new posts How to delete a user's alias from the... JCL & VSAM 11
No new posts user exit in IBM Infosphere Optim DB2 8
No new posts Running a Job with the Default User ID JCL & VSAM 2
No new posts the system or user abend SF0F R=NULL COBOL Programming 0
Search our Forums:

Back to Top