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

Storing the data Vs Multiple writing


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
highspirits

New User


Joined: 16 May 2007
Posts: 3
Location: india

PostPosted: Tue Aug 30, 2011 10:39 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Aug 31, 2011 12:10 am
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Aug 31, 2011 12:19 am
Reply with quote

Dick,

Thanks, thought it was just me.... icon_wink.gif

Mr. Bill
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Aug 31, 2011 12:21 am
Reply with quote

no problem Bill,

besides,
why make two CALLs?.

CALL the submodule once with both records!
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Wed Aug 31, 2011 1:10 am
Reply with quote

Are O1 and O2 really one one physical record? Or are you just trying to make sure they are contiguous?
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Wed Aug 31, 2011 2:03 am
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Aug 31, 2011 2:07 am
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Aug 31, 2011 2:20 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Aug 31, 2011 2:28 pm
Reply with quote

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
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top