Page 1 of 1

Send report from CICS

PostPosted: Tue Mar 30, 2010 8:00 pm
by lal
Hi Friends,
We have a CICS transaction which runs at a scheduled time and generates a JES report which is printed on the printer. We have a requirement to have this report also printed on some 3rd party reporting tool. We use these 3rd party reporting tool to send all our reports from our batch job for the users to look.

I have some ideas but need some additional tips to do this:-
1) (a) From the CICS program write the report to a file (VSAM).
(b) Then after the transaction is completed trigger a batch job (This is the part I am not clear??? may be writing to a TDQ???)
(c) This batch job/program will close the VSAM file for CICS and send the report data from the VSAM file to the reporting software.

Any other ideas please suggest me the best possible way to do this.

Thanks,
lal

Re: Send report from CICS

PostPosted: Tue Mar 30, 2010 8:08 pm
by Robert Sample
You definitely need to contact your site support group. These days most CICS regions have a DD name pointing to the JES internal reader. Your program would use WRITEQ TD to the appropriate TDQ, which would cause the JCL you write to be submitted to the internal reader. You also need to find out from the site support group how to do the batch close of the CICS VSAM file -- not all sites have a product to do this.

Re: Send report from CICS

PostPosted: Tue Mar 30, 2010 8:23 pm
by lal
Hi Robert Sample
Thanks for the suggestion. Our site do provide us to close the CICS file from batch so that's not an issue. I think I got my answer, please correct me if I am wrong.

I have to build the vsam file with the report in my CICS program and once the transaction is completed write the JCL built within the CICS program to close the vsam file and send the report to appropriate location to the internal reader.

Once that is done the batch job will be submitted and report is send to my destination.

Thanks much...

Thanks,
lal

Re: Send report from CICS

PostPosted: Tue Mar 30, 2010 8:33 pm
by Robert Sample
Basically, you've got it. Some things to watch out for: The buffer may not be flushed until the VSAM file is closed, so CICS may not write all the records to the VSAM file until the close is issued. You may also need a /*EOF at the end of your JCL to force the internal reader to release the job immediately. Unless there's a USER parameter on the job card, the JCL will inherit the CICS region user id, not yours.

Re: Send report from CICS

PostPosted: Tue Mar 30, 2010 9:17 pm
by lal
Thanks Robert Simple, I will make sure about that and put /*EOF statement at the end of my JCL. I will let you know in case of any issues.

I was reading online and found that we can use new CICS TS feature which supports SPOOL OPEN/WRITE commands which directly submits job to JES. The advantage of using these commands are, no need of destination table definitions, no need of assingning TDQ in the CICS startup JCL to INTRDR etc.

And fortunately our installation does support these SPOOL commands but was never used to submit JCL. If this is the case can I write the JCL statements using SPOOL commands and execute my job?

Thanks,
lal

Re: Send report from CICS

PostPosted: Tue Mar 30, 2010 9:25 pm
by Robert Sample
Yes, you can do the same with SPOOLWRITE commands. I wasn't sure which version of CICS you are running, but if the SPOOL commands are available I'd start with them.