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

Receive data stream from web screen to COBOL Stored Procedur


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
lvrajesh

New User


Joined: 14 Dec 2010
Posts: 3
Location: Chennai

PostPosted: Fri Nov 25, 2011 5:31 pm
Reply with quote

Hello,

Scenario: User gives the key fields thru web. On receiving the key values, cobol Stored procedure will read the desired DB2 table and pass on the desired field values back to the web-screen. There will be more than one result row to be displayed in the screen.

User will make some changes to the fields of each row in the web-screen and this values should be received by cobol stored procedure and post the updates back into the table.

Planning to have 2 SP's for the above but I like to know how to receive the updated multiple rows from the web-screen to second SP.

Appreciate all your suggestions.
Back to top
View user's profile Send private message
ajeshrn

New User


Joined: 25 Mar 2009
Posts: 78
Location: India

PostPosted: Thu Dec 08, 2011 4:53 pm
Reply with quote

Hello lvrajesh,

I understood your question this way, please correct me if I am wrong.

You have a web application which interacts with COBOL stored procedure. The screen passes values to the procedure , after which the procedure processes the record and passes the value back to the web application.

Are you trying to send the results back to the screen as resultset or are you sending them back through output parameters?
Back to top
View user's profile Send private message
lvrajesh

New User


Joined: 14 Dec 2010
Posts: 3
Location: Chennai

PostPosted: Tue Dec 13, 2011 4:20 pm
Reply with quote

Hi Ajesh,

Java interface (web screen) need to pass the set of records (which has some fields modified by user) to COBOL Stored Procedure. In Cobol program validations will be done and the changes will be updated to the appropriate table in the database.

I like to know the logic of retrieving the multiple records from the java interface in COBOL SP.

PS:I work on the COBOL programming part.

Appreciate your inputs!

Regards
Back to top
View user's profile Send private message
bhairon singh rathore

New User


Joined: 19 Jun 2008
Posts: 91
Location: banglore

PostPosted: Thu Dec 15, 2011 12:17 pm
Reply with quote

Return a result set to frontend ( Java) thru DB2 stored proc.
Back to top
View user's profile Send private message
lvrajesh

New User


Joined: 14 Dec 2010
Posts: 3
Location: Chennai

PostPosted: Thu Dec 15, 2011 2:57 pm
Reply with quote

bhairon singh rathore wrote:
Return a result set to frontend ( Java) thru DB2 stored proc.


Thanks for the reply. But guess you haven't got my question. I'm looking at receiving multiple records from fronend(Java) to Cobol Stored Procedure.

To make things clear to all, I paraphrase my requirement again:

1) User gives the key fields thru front-end(Java).
On receiving the key values, cobol SP-1 will read the DB2 table and pass on
the resulting records back to the web-screen. There will be more than
one result row(anticipating it to be in hundreds) to be displayed in the
front-end(Java) screen.

I am clear on coding the above part. No questions there.

2) Of the returned records in the front-end(Java) screen, user will be able to
make changes to couple of fields in each record. So we are looking at
receiving back the records from front-end screen with the user changes in
Cobol SP-2 and make the changes in the database.

Query here is how we need to design to receive multiple records from front-
end(Java) screen in Cobol SP-2.

Hope I have given my query clearly. Appreciate your thoughts & inputs!

Regards.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Dec 15, 2011 3:28 pm
Reply with quote

Why multiple records? Every updated record should trigger a database
update.
Back to top
View user's profile Send private message
bhairon singh rathore

New User


Joined: 19 Jun 2008
Posts: 91
Location: banglore

PostPosted: Thu Dec 15, 2011 3:34 pm
Reply with quote

Hi,

I think you would be sending one set of record at a time....So SP could be called every time you are editing and making the changes in database....I am not sure how would you edit multiple record at a time....
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Dec 15, 2011 3:35 pm
Reply with quote

bhairon singh rathore wrote:
Hi,

I think you would be sending one set of record at a time....So SP could be called every time you are editing and making the changes in database....I am not sure how would you edit multiple record at a time....


Thanks for your support.
Back to top
View user's profile Send private message
bhairon singh rathore

New User


Joined: 19 Jun 2008
Posts: 91
Location: banglore

PostPosted: Thu Dec 15, 2011 4:01 pm
Reply with quote

Hi Peter,

I didn't refresh my screen before sending the reply...so reply was duplicated....anyways if system has some time lag for updating record and huge number of records, changes could be written into file and batch process can update the records simultaneously...

Just a optional option to go forward icon_idea.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Dec 15, 2011 4:06 pm
Reply with quote

bhairon singh rathore wrote:
Hi Peter,

I didn't refresh my screen before sending the reply...so reply was duplicated....anyways if system has some time lag for updating record and huge number of records, changes could be written into file and batch process can update the records simultaneously...

Just a optional option to go forward icon_idea.gif


Thats a nice idea, i myself was thinking about multi threading. Like 1 thread for changing and another thread to do the update.
Back to top
View user's profile Send private message
ajeshrn

New User


Joined: 25 Mar 2009
Posts: 78
Location: India

PostPosted: Thu Dec 15, 2011 4:29 pm
Reply with quote

So rajesh, I believeyou would be sending multiple records tothe java screen, where it gets modified, now you want to get that data back from Java (the modified data).

If this is what you are looking for, please try having an input parameter as CLOB for your SP. Now Java should build a string with all the inputs and send you as a continouos stream.

For example:

The data u send to Java is

Code:

ABCD
EFGH
HIJK
LMNO


Java edits the second row as STPR


they should be sending the value as
Code:
ABCDSTPRHIJKLMNO
to your CLOB input parameter.
Now you have to split them in your COBOL DB2 stored procedure and iterate it and update the table.

I am not sure if we can use this if the record size is huge, and not sure it this will work if yuu are sending 1000's of record to Java and expecting the same back from them.[/code]
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Thu Dec 15, 2011 5:27 pm
Reply with quote

It's a usual scenario when you write a COBOL-DB2 SP, isn't it? Have you any other DB2-SP at your shop from where you can take a reference about it, that'd be the best - if that's not an option, suggest you look in to the chapter 9 here: Getting Started with DB2 Stored Procedures.
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts COBOL sorting, with input GDG base COBOL Programming 7
No new posts Need help with ADABAS query (COBOL-AD... All Other Mainframe Topics 0
No new posts db2 vs static data COBOL Programming 1
No new posts Replacing FILLER with FILLER<SeqNu... DFSORT/ICETOOL 2
No new posts External data queue (changes?) CLIST & REXX 0
Search our Forums:

Back to Top