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
 

 

How to code this Cobol logic

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

New User


Joined: 21 May 2008
Posts: 22
Location: chennai

PostPosted: Fri Jan 02, 2009 10:46 am    Post subject: How to code this Cobol logic
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    Post subject: Reply to: Cobol logic
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: 22
Location: chennai

PostPosted: Fri Jan 02, 2009 12:33 pm    Post subject:
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    Post subject: Reply to: Cobol logic
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    Post subject: Reply to: How to code this Cobol logic
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: 22
Location: chennai

PostPosted: Fri Jan 02, 2009 1:56 pm    Post subject:
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: 8118
Location: East Dubuque, Illinois, USA

PostPosted: Fri Jan 02, 2009 4:25 pm    Post subject:
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: 22
Location: chennai

PostPosted: Fri Jan 02, 2009 4:27 pm    Post subject:
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    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 UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am


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