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
 

 

Storing the data Vs Multiple writing

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Storing the data Vs Multiple writing
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    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Aug 31, 2011 12:19 am    Post subject: Reply to: Storing the data Vs Multiple writing
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    Post subject:
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    Post subject:
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: 236
Location: Cincinnati OH USA

PostPosted: Wed Aug 31, 2011 2:03 am    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Wed Aug 31, 2011 2:07 am    Post subject:
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: 1219
Location: Israel

PostPosted: Wed Aug 31, 2011 2:20 pm    Post subject: Re: Storing the data Vs Multiple writing
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm


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