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
 

 

Receive data stream from web screen to COBOL Stored Procedur

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Receive data stream from web screen to COBOL Stored Procedur
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    Post subject:
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    Post subject: Reply to: Receive data stream from web screen to COBOL Store
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    Post subject: Reply to: Receive data stream from web screen to COBOL Store
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    Post subject: Re: Reply to: Receive data stream from web screen to COBOL S
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Dec 15, 2011 3:28 pm    Post subject:
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    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Dec 15, 2011 3:35 pm    Post subject:
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    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Dec 15, 2011 4:06 pm    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Thu Dec 15, 2011 5:27 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 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
No new posts How to move a long alphanumeric data ... lind sh COBOL Programming 6 Mon Dec 05, 2016 7:51 pm
No new posts IMS DC screen Access sivasaras IMS DB/DC 3 Fri Nov 18, 2016 6:38 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm


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