View previous topic :: View next topic
|
Author |
Message |
highspirits
New User
Joined: 16 May 2007 Posts: 3 Location: india
|
|
|
|
I have following issue.
I have 2 programs "A" and "B". "A" is the calling program and "B" is the called program and both are Splitter programs (ie., executed both in batch and CICS calls). For each policy in the input file, there are 2 records. Program A reads first record, calls Program B. B processes the record, generates some output and returns the control back to A. This process repeats again for record B.
With this setup, I need to accomplish below task.
I need to write the output generated in program B into a VSAM file. For each policy in the input file, since B is called twice, I have 2 outputs O1 and O2 to be written to output. But since program B is a splitter program, the outputs generated will be retained between program calls in a Batch call but not in CICS call.
I could figure out 3 possible ways of writing O1 and O2 to output:
1) Read and Write twice for each policy -- When record 1 is read and output O1 is generated by program B, write O1 to the VSAM file in batch and CICS call. When record 2 is read and output O2 is generated, rewrite the data into the VSAM file.
2) Store data in linkage section between calls -- Store O1 in linkage section. Then in the second call to program B, generate O2 and write O1 and O2 to output.
3) Use pointer for output O1, only for CICS call -- Since data will be retained between calls in working storage section for batch call, use pointer to outptu O1 for CICS call only. So when O1 is generated, store it in linkage section for CICS processing and store in working storage section for batch processing. When Program B is called for the second time, write O1 and O2 to output.
Of the 3 options avaliable, I see 3rd option is the best because in CICS, we just send the pointers and not the entire storage in linkage section.
Please do let me know if there are another options avaliable or if you need any more information on this. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
Of the 3 options avaliable, I see 3rd option is the best because in CICS, we just send the pointers and not the entire storage in linkage section. |
you don't know what you are talking about.
read the manual, learn something,
and then come back if you have questions. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Dick,
Thanks, thought it was just me....
Mr. Bill |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
no problem Bill,
besides,
why make two CALLs?.
CALL the submodule once with both records! |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
Are O1 and O2 really one one physical record? Or are you just trying to make sure they are contiguous? |
|
Back to top |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 419 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
Just for fun!
Definition of CONTIGUOUS
1
: being in actual contact : touching along a boundary or at a point
2
of angles: adjacent
3
: next or near in time or sequence
4
: touching or connected throughout in an unbroken sequence <contiguous row houses>
— con·tig·u·ous·ly adverb
— con·tig·u·ous·ness noun |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I go with dbz on both counts. If you need to read two records, read them and "pass" both to the called program at the same time. That occupies exactly the same amount of storage in the linkage section as your "pointer" solution. None. Nothing in the linkage section itself takes up storage, it is just a "map" of another area of memory somewhere (or an 0C4 waiting to happen, if not). The "map" is connected to the location by - an address. What do you have in a pointer? An address. No dire need for pointers here when it can all be standard USING matching up with USING. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
highspirits wrote: |
...both are Splitter programs (ie., executed both in batch and CICS calls)... |
Do you mean you have code like this:
Code: |
IF I-AM-IN-BATCH THEN
OPEN MYFILE
ELSE
CONTINUE
END-IF
.
.
.
IF I-AM-IN-BATCH THEN
READ ONERECORD
ELSE
EXEC CICS READ FILE(MYFILE) INTO(ONERECORD)
END-IF |
brrr
highspirits wrote: |
...But since program B is a splitter program, the outputs generated will be retained between program calls in a Batch call but not in CICS call... |
Are you sure about that? If you call program B twice in CICS during the same task, working storage is preserved. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
I believe 'SPLITTER' is another of those made-up terms, like 'convert using jcl'
when we are using the old school method of creating separate loadlibs for batch and cics,
most of us refer to these type of modules as dual.
also notice the TS has not returned. |
|
Back to top |
|
|
|