Page 1 of 1

CICS Transaction at fix interval

PostPosted: Mon Jun 04, 2012 3:36 pm
by sinmani
Suppose I have a process which write a VSAM file (KSDS).

Now I want that after say every 30 minutes another transaction should get initiated which uses this VSAM file as input and processes the records.

How many ways I there to achieve this??
===============
What I beleive is I can code a transaction like
START
EXEC CICS START
TRANSID (AAAAA)
TERMID (BBBBB)
FROM (CCCCC)
LENGTH (LENGTH OF CCCCC)
INTERVAL(003000)
RESP (WS-RESP)
END-EXEC.

Here Interval would be 30 minutes between this transaction is initiated. This could be one way. Any other??

================
Secondly when the next time the transaction pick up the VSAM file it will again process the records which it already processed during the first processing.
how can I ensure that the next time when the transaction gets initiated it should start processing only the new records which got added to the file in teh duration between 2 transactions??

Re: CICS Transaction at fix interval

PostPosted: Mon Jun 04, 2012 7:43 pm
by Monitor
Exec CICS Start Transid() Interval() FROM(varname) - save some info in the varname and use the Exec CICS Retrieve Into(varname) to get the data in the started transaction. Issue the Retrieve again, to have CICS give you condition ENDDATA, otherwise the transaction will be restarted over and over.
If you had looked up the command in the manual, you would have found this!

Re: CICS Transaction at fix interval

PostPosted: Tue Jun 05, 2012 8:06 am
by dick scherrer
Hello,

You should be able to do what you want using the system scheduling software and have a batch job initiate the cics transaction periodically as is needed.

Re: CICS Transaction at fix interval

PostPosted: Tue Jun 05, 2012 10:07 am
by Monitor
Dick, what do you mean with "keeping alive" ?
The start command is an simple way och scheduling new tasks in CICS and could be done without involving any scheduling software and the overhead of a batch job with EXCI-interface.
The Interval Control Element has to taken care of by CICS, but any scheduling, CICS or other software, needs a timer. The first occurance of the transaction could easily be started as a PLTPI-program, which makes the CICS solution independent of other software.
All to my opinion, but there are always a few alternatives!

Re: CICS Transaction at fix interval

PostPosted: Tue Jun 05, 2012 5:41 pm
by sinmani
Yes,

The DELAY , INTERVAL etc these commands have been specifically designed so save CICS resources.

They go in sleep mode and are triggered only at the specified time interval.

Re: CICS Transaction at fix interval

PostPosted: Tue Jun 05, 2012 10:10 pm
by dick scherrer
Hello,

Someone more familiar with this than i am will reply (i'm sure).

They go in sleep mode and are triggered only at the specified time interval
.
I suspect that having a process "sleep" does tie up some resources. The scheduler is already running all of the time, so there would be nearly no additional "cost" to schedule this.
See next post - Looks like tying up resources does NOT happen - Thanks Robert!

I also suspect that nearly everything that runs regularly is controlled by the schedule. IMHO, it is better to manage all of this in one place.

Re: CICS Transaction at fix interval

PostPosted: Tue Jun 05, 2012 10:43 pm
by Robert Sample
Interval started tasks don't "waste" resources -- CICS is able to handle starting a task at a particular time in the future without keeping anything active. However, i see a few issues: (1) are you planning doing interval starts throughout the day -- if so, what if a transaction dies before starting the next one? (2) How will your initial transaction be started (the usual method is to build a PLT entry for it)? (3) Your START uses a terminal id and most interval started tasks run unattached to a terminal (what happens if the terminal is in use when it is time for the transaction to start)? (4) Your post has 5 bytes for terminal id and 5 bytes for transaction id -- are you aware that neither value can have 5 bytes?

There are three common methods for handling your second question about the VSAM file records: (1) have a flag in the record to indicate your program has processed the record, and update that flag during your processing, (2) have the time stored in the record and each transaction outputs a record (to TSQ, to a VSAM record, or whatever) with the last time value processed, (3) if the VSAM file is KSDS, have the last record key processed saved (again, to TSQ or whatever) before the transaction ends. There are other ways, of course.

Re: CICS Transaction at fix interval

PostPosted: Thu Jun 07, 2012 6:38 pm
by sinmani
Robert Sample wrote:(4) Your post has 5 bytes for terminal id and 5 bytes for transaction id -- are you aware that neither value can have 5 bytes?



Yes Robert , That sd have been 4 bytes. That was a typo.
Thanks for your response

Re: CICS Transaction at fix interval

PostPosted: Thu Nov 29, 2018 3:34 pm
by AnandB
deleted - tail-gating old topic.