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

Use of INTERVAL in START command


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
senthils

Active User


Joined: 15 Nov 2005
Posts: 117
Location: Chennai, India

PostPosted: Tue Nov 11, 2008 11:22 am
Reply with quote

Hi,

I want to know the exact use of INTERVAL parameter used in START TRANSID command.


My requirement is for a transaction to be triggered at regular time interval.

So to start transaction 'AAAA' every 2 minutes if i give the following command will it suffice?

Code:
EXEC CICS START                               
          INTERVAL (000200)       
          TRANSID      ('AAAA')         
          FROM         (DFHCOMMAREA)         
          LENGTH       (LENGTH OF DFHCOMMAREA)
END-EXEC
Back to top
View user's profile Send private message
Prasanthhere

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Tue Nov 11, 2008 12:13 pm
Reply with quote

How abt this

publib.boulder.ibm.com/iseries/v5r2/ic2924/books/c415454128.htm
Back to top
View user's profile Send private message
senthils

Active User


Joined: 15 Nov 2005
Posts: 117
Location: Chennai, India

PostPosted: Tue Nov 11, 2008 12:21 pm
Reply with quote

Thanks for the link Prasanth.

According to the info from the link I can say,

INTERVAL basically says how much time which must elapse before the transaction is started. But it wont repeatedly start the transaction after that.

Is the above statement correct?
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Tue Nov 11, 2008 2:52 pm
Reply with quote

If you want to write a program, you can use the below psuedo code.

Code:

01 sleep-time pic 999.
01 begin-time pic 9(06) value zeroes.
01 filler redefines begin-time.
   05 begin-hours pic 99.
   05 begin-minutes pic 99.
   05 begin-seconds pic 99.

01 end-time pic 9(06) value zeroes.
01 filler redefines end-time.
   05 end-hours pic 99.
   05 end-minutes pic 99.
   05 end-seconds pic 99.

01 elapsed-time pic 9(6).

procedure division.
   ctr = 0.
   read indicator.
   perform sleep-it until cntr = 5 or indicator = 'y'.
   IF IND = 'Y'
      RUN PROGRAMME
   ELSE
      stop run
   end-if.

sleep-it.

   accept begin-time from time
   move 0 to elapsed-time
   sleep-time = 120

   perform until elapsed-time >= sleep-time

   accept end-time from time
   compute elapsed-time rounded =
   ( end-hours - begin-hours ) * 3600
   + ( end-minutes - begin-minutes ) * 60
   + ( end-seconds - begin-seconds )

   end-perform.
   add 1 to cntr.
   read indicator.


If you want to use CICS command, you can try with the following format.

Code:

IF YES--STRT-ABCD   
  EXEC CICS START   
    TRANSID  ('ABCD')
    INTERVAL (0030) 
  END-EXEC           
END-IF               


Declare the flag in 88 level and assign the flag value depending on condition or as many times as you want, depending on your requirement.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Nov 11, 2008 3:22 pm
Reply with quote

instead of a cpu wasting perform (rookie garbage), suggest you use the CICS DELAY API command.
Back to top
View user's profile Send private message
senthils

Active User


Joined: 15 Nov 2005
Posts: 117
Location: Chennai, India

PostPosted: Tue Nov 11, 2008 3:38 pm
Reply with quote

Thanks for all your replies. I think got what I needed.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Nov 11, 2008 5:51 pm
Reply with quote

The INTERVAL START only runs once; if you want to repeated trigger a transaction every 2 minutes you need each transaction to do an INTERVAL START on the next one. I've done several of these so if you have more questions please post them.
Back to top
View user's profile Send private message
senthils

Active User


Joined: 15 Nov 2005
Posts: 117
Location: Chennai, India

PostPosted: Tue Nov 11, 2008 5:58 pm
Reply with quote

Thanks Robert. I came up with the same logic and it is working now.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Nov 12, 2008 3:58 am
Reply with quote

Hello,

If no one objects (and maybe even if they do), i plan on deleting the cpu-wasting code to "kill time" for some interval.

None of the systems i've ever supported would allow this in a cics region (or batch application for that matter).

I would suggest that a far better approach is the one Robert posted. Easy to understand, easy to maintain, and easy on the system resources icon_smile.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Nov 12, 2008 4:50 am
Reply with quote

To make it a very solid design, use two transactions, both interval-controlled, and a record in a VSAM file. The VSAM record has the timestamp for the last start for each transaction. The first transaction when started reads the VSAM record for update, verifies that the other transaction has a timestamp within the specified interval (determined by you -- probably should be 1.5 to 2 times the interval being used), updates its timestamp, rewrites the record, and does an interval start on itself. The second transaction when started reads the VSAM record for update, verifies that the first transaction has a timestamp within the specified interval, updates its timestamp, rewrites the record, does what work it needs to, and then does an interval start on itself. As long as you don't hit MAXTASK, this design is pretty much fool-proof. It also allows for extensions, such as a flag in the record to shut down the transactions (which can be set by CECI even).
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts LTJ command CA Products 4
No new posts Query on edit primary command CLIST & REXX 5
Search our Forums:

Back to Top