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

How to code this Cobol logic


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mighty

New User


Joined: 21 May 2008
Posts: 26
Location: chennai

PostPosted: Fri Jan 02, 2009 10:46 am
Reply with quote

I have n number of address.
For each address there is some number given.
and i want to take adress which has maximum number.
Please anyone let me know how to code this logic in COBOL
Back to top
View user's profile Send private message
Cristopher

New User


Joined: 31 Jul 2008
Posts: 53
Location: NY

PostPosted: Fri Jan 02, 2009 12:22 pm
Reply with quote

Mighty,Please provide an example(with the input and expected output) for your query.

Cris
Back to top
View user's profile Send private message
mighty

New User


Joined: 21 May 2008
Posts: 26
Location: chennai

PostPosted: Fri Jan 02, 2009 12:33 pm
Reply with quote

We have Response in which address are returned.
For each address there is one confidence level produced.
we have to select a adress with highset level number and write that in file
Back to top
View user's profile Send private message
Cristopher

New User


Joined: 31 Jul 2008
Posts: 53
Location: NY

PostPosted: Fri Jan 02, 2009 1:01 pm
Reply with quote

Mighty, I was expecting an example with some sort of data.
Quote:
We have Response in which address are returned.

From where do u receive this RESPONSE,do you call a module and it returns certain value,where it gets stored?So,for each RESPONSE u have a single address and an associated level number or multiple addresses.
When do u finally go for writing into the file?

Cris
Back to top
View user's profile Send private message
Cristopher

New User


Joined: 31 Jul 2008
Posts: 53
Location: NY

PostPosted: Fri Jan 02, 2009 1:50 pm
Reply with quote

Mighty,with the information that you have provided, i can suggest you to use two working storage variables to store address and level number. Every time after u receive the response compare the current level number value with the previous one.If it is greater then replace both (the address and the level number )else continue.

At the end of the cycle move the address from the variable into the file.

Cris
Back to top
View user's profile Send private message
mighty

New User


Joined: 21 May 2008
Posts: 26
Location: chennai

PostPosted: Fri Jan 02, 2009 1:56 pm
Reply with quote

Can you please put this "If it is greater then replace both (the address and the level number )else continue." in cobol logic.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Jan 02, 2009 4:25 pm
Reply with quote

Are you only writing the one address with the highest confidence level to the file, or are you going to write them all to the file in descending confidence level order?
Back to top
View user's profile Send private message
mighty

New User


Joined: 21 May 2008
Posts: 26
Location: chennai

PostPosted: Fri Jan 02, 2009 4:27 pm
Reply with quote

Actually i got my answer from Cris solution.
Now my code is working fine.
I am writing the one address with the highest confidence level .

Thanks for your help. icon_smile.gif
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts run rexx code with jcl CLIST & REXX 15
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Compile rexx code with jcl CLIST & REXX 6
Search our Forums:

Back to Top