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
 

 

Cobol Logic to find identical Bdates

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

New User


Joined: 21 Jul 2005
Posts: 23
Location: USA

PostPosted: Tue Jan 13, 2009 12:04 am    Post subject: Cobol Logic to find identical Bdates
Reply with quote

Hi,
Please help me in getting one cobol logic..

requirement:
here there are employee and family....... in my case..I'm employee and my spouse and kids are family..
requirement is to find out those kids having same Birth date. Birth date mm/dd/yy

If kids having same birth date then pass a parameter to 'Tbirth flag'

reading the records from Flat file... I just want the logic.

regards,
Nirenchan..
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Tue Jan 13, 2009 12:26 am    Post subject:
Reply with quote

Your problem statement leaves a lot to be known:
One record per employee -- if so, what's the maximum number of kids?

Multiple records per employee (one per spouse, one per kid)? If so, how are the records distinguished? Is there an end of employee marker or just when the employee id changes? What kind of employee id is used?

Looking for exact matches on year, month, day? What about twins, triplets or higher -- how to handle them?

And, finally, what's wrong with an IF statement in COBOL?
Back to top
View user's profile Send private message
nirenchan

New User


Joined: 21 Jul 2005
Posts: 23
Location: USA

PostPosted: Tue Jan 13, 2009 1:15 am    Post subject:
Reply with quote

one record per employee,spouse and kids
we have ways to get number of kids.
match -kids date of birth...mm/dd/yy and if match is there just pass indicator to flag
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Tue Jan 13, 2009 1:31 am    Post subject:
Reply with quote

Since it's one record -- just use an IF statement comparing the fields you want to compare. Easier if the record layout has an array to compare the birthdays, but not that hard otherwise; compare first to second, first to third, etc then second to third, second to fourth, etc until done.
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 Jan 13, 2009 1:32 am    Post subject:
Reply with quote

Hello,

If you post some sample records for a few families with varying numbers of kids and show the "output" you want from each, it will help someone help you.

Are you trying to identify twins, triplets, etc or simply kids born on the same mm/dd?
Back to top
View user's profile Send private message
nirenchan

New User


Joined: 21 Jul 2005
Posts: 23
Location: USA

PostPosted: Tue Jan 13, 2009 2:04 am    Post subject:
Reply with quote

need to find kids born on same day....
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 Jan 13, 2009 2:10 am    Post subject:
Reply with quote

Quote:
need to find kids born on same day....
Ok, now post the requested sample input for a few families and what you want fro mthat input.

Your request is completely clear to you, but not others. . .
Back to top
View user's profile Send private message
nirenchan

New User


Joined: 21 Jul 2005
Posts: 23
Location: USA

PostPosted: Tue Jan 13, 2009 2:17 am    Post subject:
Reply with quote

sample..

record having employee name dob, spouse, name dob, kids(1,-name dob 2-name dob,3-name dob..)

kids varing depends on family

need to find kids having same dob. ths is for existing records..want a new indicator.. then from that indication we cna identify this employee having kids with same dob
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 Jan 13, 2009 2:38 am    Post subject:
Reply with quote

Hello,

One more time. . . . You need to show sample records for a few families - not a record layout.
Back to top
View user's profile Send private message
nirenchan

New User


Joined: 21 Jul 2005
Posts: 23
Location: USA

PostPosted: Tue Jan 13, 2009 3:03 am    Post subject:
Reply with quote

sorry..I dont have sample records...

I just want the logic how to get the dob match.


thanks
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Tue Jan 13, 2009 3:18 am    Post subject: Reply to: Cobol Logic to find identical Bdates
Reply with quote

the logic depends on the record layout and dataset organization icon_smile.gif

there are two alternatives

variable length record with logical sections ( that could be there or not )
for example
Code:

single employee    ==> employee section
married            ==> employee section + wife section
married + children ==> employee section + wife section + child section 1 + child section 2 + ..... + child section n
widower + children ==> employee section + child section 1 + child section 2 + ..... + child section n


or one record for each family member
for example the layout could be
employee_code record_type additional data

each family group would contain as many records as there would be sections
with the same logic

for sequential dataset processing
to obtain the result would require a multipass approach

but until You are more specific on the requirement little we can do
Back to top
View user's profile Send private message
nirenchan

New User


Joined: 21 Jul 2005
Posts: 23
Location: USA

PostPosted: Tue Jan 13, 2009 3:27 am    Post subject:
Reply with quote

thanks enrico

The record some thinglike

its fixed :
employee# employee name spouse-name child1-name child2 ....

I'm sorry if I'm confusing you..

thanks guys...
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 Jan 13, 2009 4:06 am    Post subject:
Reply with quote

Hello,

Quote:
sorry..I dont have sample records...
Invent some. It should not be difficult to make up some "fake" records that demonstrate the data you need to process.

You need to show the data content both so we can understand the input as well as offer suggestions as to how you can provide the "output" you want.

Until the input data format is resolved there and understood here, it is a complete waste of time to consider process details.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Tue Jan 13, 2009 5:51 pm    Post subject:
Reply with quote

Nirenchan: you say
Quote:
I just want the logic.
But without providing details about the implementation, the logic cannot be anything more than a very high-level overview. This overview has been provided to you for your use: compare kid one's birthday to kid two's, kid one's to kid three's, ... kid one's to kid n's; then compare kid two's to kid three's, ... kid two's to kid n's, and so forth.
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 Jan 14, 2009 1:52 am    Post subject: Reply to: Cobol Logic to find identical Bdates
Reply with quote

Looks like it may have been too much effort to put into a homework assignment. . . icon_neutral.gif

d
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Jan 14, 2009 12:46 pm    Post subject:
Reply with quote

Hello,
Quote:
Looks like it may have been too much effort to put into a homework assignment
Agreed. Period.
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 How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am


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