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

how to provide time delay before we drop a temporary table?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bittu
Warnings : 1

New User


Joined: 07 Jan 2007
Posts: 19
Location: Bangalore

PostPosted: Fri Nov 30, 2007 12:20 pm
Reply with quote

Hi All,

My program is referncing a global temporary table which i will be dropping it by drop statement. My question is how do i give a time delay of say 3-5 mins to check whether the data is written into the global temp table and later its dropped.
Please send me the syntax for dropping the global temporary table with a time delay.

Thanks in advance
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 30, 2007 1:01 pm
Reply with quote

Quote:
data is written into the global temp table and later its dropped.


Something is missing here :-)

Usually the process flow is to read a permanent table,
for some reason ( not really important here ) create a temporary table
process the temporary table
drop the temporary table


since the table is temporary when You drop the table...
why do You care if the data has been written or not ???
Back to top
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 148
Location: Ottawa Canada

PostPosted: Fri Nov 30, 2007 10:45 pm
Reply with quote

Below is one way to do it from batch. In CICS use DELAY.

Note: Your systems people may not be happy with you if you tie up a batch initiator with a job that spends most of its time sleeping. I received an angry call because someone used the logic below to sleep their program for an hour...

Code:

WAIT     CSECT                                           
WAIT     AMODE 31                                         
WAIT     RMODE ANY                                       
         EQUREG                                           
         SAVE (14,12),,'RH0WT &SYSDATE &SYSTIME'         
         LR    R12,R15                                   
         USING RH0NWT,R12                                 
         L     R3,0(,R1)                                 
         MVC   INTERVAL,0(R3)                             
         STIMER WAIT,BINTVL=INTERVAL                     
         LM    R14,R12,12(R13)         RELOAD REGS,       
         XR    R15,R15                 BACK TO THE BOSS   
         BR    R14                                       
         DS    0F                                         
INTERVAL DS    F                                         
         END WAIT

How to call from COBOL

01 WS-SLEEP-ROUTINE     PIC X(8) VALUE 'WAIT'. 
01 WS-TIME-INTERVAL     PIC S9(9) COMP.           
   88 WS-SLEEP-1-HUNDRETH-OF-A-SEC VALUE     +1. 
   88 WS-SLEEP-1-TENTH-OF-A-SEC    VALUE    +10. 
   88 WS-SLEEP-1-SECOND            VALUE   +100. 
   88 WS-SLEEP-1-MINUTE            VALUE  +6000. 
   88 WS-SLEEP-5-MINUTES           VALUE +30000. 
                                                 
SET WS-SLEEP-1-MINUTE TO TRUE 
CALL WS-SLEEP-ROUTINE   USING WS-TIME-INTERVAL   

Back to top
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 148
Location: Ottawa Canada

PostPosted: Fri Nov 30, 2007 10:47 pm
Reply with quote

Sorry - typo fix.

Code:


WAITME   CSECT                                               
WAITME   AMODE 31                                             
WAITME   RMODE ANY                                           
         EQUREG                                               
         SAVE (14,12),,'WAITME &SYSDATE &SYSTIME'             
         LR    R12,R15                                       
         USING WAITME,R12                                     
         L     R3,0(,R1)                                     
         MVC   INTERVAL,0(R3)                                 
         STIMER WAIT,BINTVL=INTERVAL                         
         LM    R14,R12,12(R13)         RELOAD REGS,           
         XR    R15,R15                 BACK TO THE BOSS       
         BR    R14                                           
         DS    0F                                             
INTERVAL DS    F                                             
         END WAITME
 
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top