View previous topic :: View next topic
|
Author |
Message |
karthikxan
New User
Joined: 28 Nov 2007 Posts: 7 Location: chennai
|
|
|
|
Hi,
I need one help,i am retrieving data from one table ,the data is available in the table in below format
0-1000
1000-2000
2000-3000
4000+
less than 5000
the logic here is if it is 0-1000,then i have to move 1000 to working storage variable,if its 1000-2000 then i have to move
2000 to the working storage variable ,like this and if it is 4000+ then i have to move 4000 to the working storage variable
if it is less than 5000 then i have to move 5000 to Ws variable
I can use a UNSTRING command with "+" or "-"(hypen) condition to filter ,but one prblem here is "less than condition"
I cannot use REXX ,the logic should be implemented in COBOL only,could you please help me in this regards
REgards
Karthik |
|
Back to top |
|
|
Srihari Gonugunta
Active User
Joined: 14 Sep 2007 Posts: 295 Location: Singapore
|
|
|
|
Karthick,
First find for
using reference modification. If its not present go for UNSTRING. simple IF ELSE should do. |
|
Back to top |
|
|
karthikxan
New User
Joined: 28 Nov 2007 Posts: 7 Location: chennai
|
|
|
|
Hi Hari,
I can find this using reference modification,but problem here is table will have data in different language like English,spanish,so all these scenarios needs to be handled
Regards
Karthik |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
table will have data in different language like English,spanish,so all these scenarios needs to be handled |
Suggest a separate bit of code for each language to be supported. |
|
Back to top |
|
|
karthikxan
New User
Joined: 28 Nov 2007 Posts: 7 Location: chennai
|
|
|
|
Hi,
I have data in this format 1000-2000 and "less than 1000"
i have to get 2000 in scenario of 1000-2000
i have to get 1000 in scenario of "less than 1000"
Please let me know how can i handle ths in Array
Regards
Karthik |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
n.karthikeyan,
a little more info is necessary:
layout of data
layout of COBOL Internal Table (array)
Quote: |
i have to get 1000 in scenario of "less than 1000" |
are you sure about this? <1000 is -infinity to +999 last i heard. |
|
Back to top |
|
|
karthikxan
New User
Joined: 28 Nov 2007 Posts: 7 Location: chennai
|
|
|
|
Hi,
The data is available like this in the table
1000-2000
2000-3000
3000+
less than 3000
can i retrieve the data for ex if it is 1000-2000,only 2000 i have to move to WS varaiable
if its 3000+ i have to move 3000 to WS variable
if it is less than 3000,i have to move only 3000 to WS variable
Regards
Kartik |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
I'm still stumped, what you want is clear to you, but it makes no sense to me.
What sort of table?
What sort of retrieve?
Please explain further. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Posting examples of your input and desired output would help us understand your requirement. And please use VBCode where appropriate. |
|
Back to top |
|
|
karthikxan
New User
Joined: 28 Nov 2007 Posts: 7 Location: chennai
|
|
|
|
Hi,
Thanks for your replies,my requirement is like this
I want to get the upper limit for a mileage and store it in working storage variables
table is having datas like this
1000-2000
2000-3000
3000-4000
lessthan 7000
7000+
for first one i have to separate and get 2000,second one i have to separate and 3000,third one i have to separate 4000 and 5th one i have to separate 7000,last one also 7000
am not going to use any JCL since its AS400 cobol,i have to implement the logic in COBOL itself |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What have you written so far? Where are you stuck?
Suggest you post "this" field as well as a few others from some sample input and show what output from this sample input should be. The "output" could be an array in the program.
In your code, parse each input value and determine the low and high value for that input. If this input is a range definition, you also need to check for overlap.
If this process is still being developed, i'd suggest that the input entries be only the "high" value. When used for determining which range to use the "low" value would be zero (for the first entry) or the previous high value. This also eliminates the need to do range-checking on the input. |
|
Back to top |
|
|
|