Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Data Extraction in COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
karthikxan

New User


Joined: 28 Nov 2007
Posts: 7
Location: chennai

PostPosted: Tue May 05, 2009 10:14 am    Post subject: Data Extraction in COBOL
Reply with quote

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
View user's profile Send private message

Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Tue May 05, 2009 10:29 am    Post subject:
Reply with quote

Karthick,
First find for
Code:
less than
using reference modification. If its not present go for UNSTRING. simple IF ELSE should do.
Back to top
View user's profile Send private message
karthikxan

New User


Joined: 28 Nov 2007
Posts: 7
Location: chennai

PostPosted: Tue May 05, 2009 10:38 am    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue May 05, 2009 12:03 pm    Post subject:
Reply with quote

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
View user's profile Send private message
karthikxan

New User


Joined: 28 Nov 2007
Posts: 7
Location: chennai

PostPosted: Tue May 05, 2009 3:48 pm    Post subject: how can i separate data ina array
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Tue May 05, 2009 4:49 pm    Post subject:
Reply with quote

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
View user's profile Send private message
karthikxan

New User


Joined: 28 Nov 2007
Posts: 7
Location: chennai

PostPosted: Tue May 05, 2009 5:12 pm    Post subject:
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue May 05, 2009 6:53 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue May 05, 2009 10:30 pm    Post subject:
Reply with quote

Posting examples of your input and desired output would help us understand your requirement. And please use VBCode where appropriate.
Back to top
View user's profile Send private message
karthikxan

New User


Joined: 28 Nov 2007
Posts: 7
Location: chennai

PostPosted: Wed May 06, 2009 11:24 am    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed May 06, 2009 1:49 pm    Post subject:
Reply with quote

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
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us