View previous topic :: View next topic
|
Author |
Message |
krishna dileep
New User
Joined: 12 Jan 2004 Posts: 3
|
|
|
|
Hi all,
Iam encountering probelm while receiving data from the online screens. My problem is...
on the online screen data is like the below format
1) 4
2) 11
3) 12
4) 40
5) 116
The user may select one or more at a time and send it to back end
suppose if a user selects 4, 11, 116,40.. the data will be send to the backend as a whole ie.. 41111640.
now my job is to split it into the existing format ie 4, 11, 116, 40 and insert them seperately into data base.
I'm trying hard to find a logic for this. but can't.
Dileep |
|
Back to top |
|
|
star_dhruv2000
New User
Joined: 03 Nov 2006 Posts: 87 Location: Plymouth, MN USA
|
|
|
|
Hi Krishna,
Quote: |
The user may select one or more at a time and send it to back end |
What does this means..
Your info is not clear please be specific and give more info.[/code] |
|
Back to top |
|
|
rakesha.hg
Active User
Joined: 21 Mar 2008 Posts: 161 Location: bangalore
|
|
|
|
hi krishna,
i had tried the same logic .......
i defined the receiving fields as a table with depending upon clause for each variable. |
|
Back to top |
|
|
krishna dileep
New User
Joined: 12 Jan 2004 Posts: 3
|
|
|
|
Hi
The user may select one or more choices at a time from the online screen. The choosen values will be send to back end for insertion into data base.
Thanks & regards
dileep |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
What type of "the online screen" is it? IMS, CICS, ISPF, ...
What is the Backend? Batch job, CICS, IMS, , other ... |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
In any screen/display application, ims,cics,ispf the screen/display fields
will be seen by the application program as different fields/variables
so just design a consistent convention of exchanging multiple fields between application stages
a basic approach would be to define a structured array ...
flag,data were flag and data are suitable data types for example pic x, pic 10x
where the flag will be '0' for no data, '1' for data passed
and process data according to the flag |
|
Back to top |
|
|
krishna dileep
New User
Joined: 12 Jan 2004 Posts: 3
|
|
|
|
Hi,
The front end is a java screen and the back end is db2.
From online screen, the data will be passed to kustode(a cobol-db2 program), where it will receive the data and insert that in to database.
hope Iam clear now.
Thanks & regards
dileep |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
krishna dileep wrote: |
suppose if a user selects 4, 11, 116,40.. the data will be send to the backend as a whole ie.. 41111640. |
How can you know that 41111640 splits into 4, 11, 116, 40 and not 41, 11, 16 and 40 ? |
|
Back to top |
|
|
star_dhruv2000
New User
Joined: 03 Nov 2006 Posts: 87 Location: Plymouth, MN USA
|
|
|
|
Quote: |
How can you know that 41111640 splits into 4, 11, 116, 40 and not 41, 11, 16 and 40 ? |
Yup that's what I was asking is there any fixed digits for each number. |
|
Back to top |
|
|
pradeep_123
New User
Joined: 21 Nov 2007 Posts: 9 Location: bhubaneswar
|
|
|
|
you can go for split the variable. The format was
Move variable1(1:2) to variable2. so that you can move the two byte of variable1 to variable2.
i think you can also do like this. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
pradeep_123 wrote: |
you can go for split the variable. The format was
Move variable1(1:2) to variable2. so that you can move the two byte of variable1 to variable2.
i think you can also do like this. |
Splitting the variable into pieces is simple and there are many ways to do it. How to know where to split the variable is the problem. |
|
Back to top |
|
|
chandu.be
New User
Joined: 17 Jul 2006 Posts: 9 Location: Bagalore
|
|
|
|
1)Since you don't have fixed format of the data that you are receiving from JAVA screens. Why can't you ask them in the required format i.e with the seperator ','. Based on the seperator you can do unstring and insert into database.
2)If they are not ready to send in the required format then you have to come up with some fixed length format i.e. say individual data length is 3, then your given string would become '004011116040'. And ask java screen developers to send the string in above format. Once you receive it you can use referrence modification to divide the data into individual peices. |
|
Back to top |
|
|
SHAILESH OZA
New User
Joined: 10 Jun 2005 Posts: 21 Location: Mumbai
|
|
|
|
Let's say your input on the screen 4,11,116,40. Store this into one variable WS-STRING, Now Appy Unstring function as below
Unstring WS-STRING into A(1), A(2), A(3), A(4),A(5) delimited by ' , '
then
it is splitted and A(5) will have space or blank value.
So while merging you can merge,
String A(1),(A2),A(3),A(4),A(5) delimited by size |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi SHAILESH OZA,
The OP said:
Quote: |
.. the data will be send to the backend as a whole ie.. 41111640.
|
Unfortunately, there are no commas in the string that was returned (unless he misspoke). |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
I must admit to being confused by this one - both now and when it was originally posted.
Quote: |
1) 4
2) 11
3) 12
4) 40
5) 116
|
If those are 5 separate fields on a screen, how did they become one contiguous series of digits? I believe if there are 5 fields, it should be fairly straight-forward to STRING them into a delimited series and then UNSTRING them later. . . If they are already in 5 screen fields, why are they combned into a single, more difficult to work with, field?
It is quite possible that there is something i misunderstand. . . |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
This looks more like a JAVA problem, how to get the JAVA screen to present the selected data in a form that allows the backend to split out the values correctly...... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Even so, the java code has separate fields ant when "forwarded" i would think they could have delimiters inserted. . . Or, be force filled to fixed length. . . |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
the last time the poster was seen alive was about 10 days ago |
|
Back to top |
|
|
|