Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
how to provide time delay before we drop a temporary table?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: how to provide time delay before we drop a temporary table?
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10358
Location: italy

PostPosted: Fri Nov 30, 2007 1:01 pm    Post subject: Reply to: how to provide time delay before we drop a tempora
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: 149
Location: Ottawa Canada

PostPosted: Fri Nov 30, 2007 10:45 pm    Post subject:
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: 149
Location: Ottawa Canada

PostPosted: Fri Nov 30, 2007 10:47 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Comparision with current time arunsoods DFSORT/ICETOOL 5 Thu Nov 09, 2017 10:37 am
This topic is locked: you cannot edit posts or make replies. Comparing current time with the time ... arunsoods SYNCSORT 1 Mon Oct 30, 2017 4:07 pm
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us