Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Use of INTERVAL in START command

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: Use of INTERVAL in START command
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    Post subject: Reply to: Use of INTERVAL in START command
Reply with quote

How abt this

http://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    Post subject:
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: 356
Location: New York

PostPosted: Tue Nov 11, 2008 2:52 pm    Post subject:
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    Post subject:
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    Post subject:
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: 7932
Location: Bellevue, IA

PostPosted: Tue Nov 11, 2008 5:51 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Nov 12, 2008 3:58 am    Post subject:
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: 7932
Location: Bellevue, IA

PostPosted: Wed Nov 12, 2008 4:50 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fail to change physical VSAM filename... jacobdng CICS 6 Fri Jan 20, 2017 12:36 pm
No new posts CICS START AND CANCEL blayek CICS 1 Wed Dec 07, 2016 3:27 am
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
No new posts SDSF Command Avtrix CLIST & REXX 4 Fri Sep 30, 2016 11:13 am
No new posts How to find a CICS resource used in C... Arunkumar Chandrasekaran CICS 8 Thu Sep 29, 2016 1:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us