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
 

 

Help regarding below business logic...

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

New User


Joined: 11 May 2007
Posts: 59
Location: chennai

PostPosted: Thu Oct 07, 2010 11:48 am    Post subject: Help regarding below business logic...
Reply with quote

Hi All,

My requirement is like this.

Identify a particular field type say field1 from file1 and map them to proper record to output file file2 to field say field2.

Field1 Name (abbreviation) field2 name
Cost Centre (KS) ZIBGN
Employee ID (PK) ZIBIW

when moving the field1 to proper output record the prefix
(ie KS ,PK) has to be deleted so only trailing charecter can be moved.

Ther can be multiple field1 abbreviation in the input record.
e.g ‘KS1234,PK5678,DS9012’

The output file look like
ZIBGN0000000000000000051234
ZIBIW0000000000000000055678
..............................................

how to approach the business logic for this.Kindly let me know if anyone didnt got the requrement?

Thanks

Puru
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


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

PostPosted: Thu Oct 07, 2010 4:43 pm    Post subject:
Reply with quote

Your explanation is clear as mud. Are you writing two records for the sample input? Why all the extra zeroes in the output records? Are you ignoring fields where the prefix doesn't match? And if so, what are you matching against -- just the KS / PK, or is there some table you didn't bother to mention that needs to be searched? What are the attributes of the input file? What are the attributes of the output file? How many fields can occur in the input file?
Back to top
View user's profile Send private message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 59
Location: chennai

PostPosted: Thu Oct 07, 2010 4:59 pm    Post subject: Reply to: Help regarding below business logic...
Reply with quote

Hi,

Are you writing two records for the sample input?

No,its depends upon how much comma separator records(fields) are there as here its only having KS1234,PK5678,DS9012 ie 3 records in the same input record in input file.
Quote:
Why all the extra zeroes in the output records?

this is as per the requirement we need not to think about that as i can move those while writing output record.
Quote:
Are you ignoring fields where the prefix doesn't match?

Yes..we need not to consider those fields
Quote:
And if so, what are you matching against -- just the KS / PK, or is there some table you didn't bother to mention that needs to be searched?

There are few more fields like KS/PK which i havent mention.Here i have
just given the example.

Quote:
What are the attributes of the input file?
What are the attributes of the output file?

i am not sure about the attribut of thes files as nothing has been mentioned bt their attribut in Business docs.

Quote:
How many fields can occur in the input file?

its maximum of 5.but i want to write a code which is not repetative and
can handle anynumber of fields separated by comma and ofcourse no. of fileds i mean which can be accomodated in input record.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu Oct 07, 2010 5:11 pm    Post subject:
Reply with quote

Quote:
Are you writing two records for the sample input?

No,its depends upon how much comma separator records(fields) are there as here its only having KS1234,PK5678,DS9012 ie 3 records in the same input record in input file.
What do you mean? You have three input fields in one input record, right? Are you expecting to get one record output, two records output, or three records output, or what? This is a simple question and you so far have failed to answer it.

Quote:
i am not sure about the attribut of thes files as nothing has been mentioned bt their attribut in Business docs.
Are the files variable length or fixed length? What are the DCB characteristics of the files?

You may not think details such as these are important, but we don't ask these types of questions just because we want to harass you -- we ask because sometimes such details can change the solution suggested.

You have three obvious approaches -- use UNSTRING repeatedly to split out the input fields based on the commas, or use reference modification to split off each input field, or you could redefine the input record as an array and scan looking for the commas, splitting off the input field as you go. Once you have an input field, you can then process it according to whatever rules you need to.
Back to top
View user's profile Send private message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 59
Location: chennai

PostPosted: Thu Oct 07, 2010 5:28 pm    Post subject: Reply to: Help regarding below business logic...
Reply with quote

Robert,


Quote:
What do you mean? You have three input fields in one input record, right? Are you expecting to get one record output, two records output, or three records output, or what? This is a simple question and you so far have failed to answer it.

Are you here to help people or pointing their fault? see my first post then you wil see i have written separate line for each input fields records.

n pls reply in a proper way or dont reply.thanks

n i have done the logic but program just i wanted to check if there is any other ideas which i can get n which can be a better approach...

thnks!!
puru
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Oct 07, 2010 5:42 pm    Post subject:
Reply with quote

Purnendu.it

Please remember that the respondants on this forum do so entirely on a voluntary basis, and are usually highly competant and experienced people.

These people ask questions because the poster has not bothered to give the information, or has ignored a request for information.

Please do not throw your teddy out of the pram if you consider a response to be rude, especially if you make a statement which is incorrect.

Quote:
Are you here to help people or pointing their fault? see my first post then you wil see i have written separate line for each input fields records.
Quote:
Ther can be multiple field1 abbreviation in the input record.
e.g ‘KS1234,PK5678,DS9012’

The output file look like
ZIBGN0000000000000000051234
ZIBIW0000000000000000055678
..............................................

We are here to help people that ask, but please treat us with respect, even more so people like Robert who has probably already forgotten more than I will know.

And also, please do not use kiddy text speak on the forum, it is supposed to be professional icon_rolleyes.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu Oct 07, 2010 6:13 pm    Post subject:
Reply with quote

Quote:
you wil see i have written separate line for each input fields records.
First, the mere fact that someone puts data on two lines doesn't necessarily mean they want two lines -- especially when they don't bother to use the Code tag which allows for complete description of the output. And someone who has been on this forum for 3 years plus should realize that by now. Second, you were given three approaches that will work in COBOL so what more do you want?

We cannot approve the business rules since you have not stated any business rules -- and those would normally be proprietary and inappropriate to post on a public forum, anyway.

You have been provided the answers you requested. Since you are not willing to answer questions about the process you need to follow, I recommend you take what you have been given and proceed.
Back to top
View user's profile Send private message
Traveler

New User


Joined: 12 Aug 2010
Posts: 8
Location: Highlands, NJ

PostPosted: Thu Oct 07, 2010 10:31 pm    Post subject: Re: Reply to: Help regarding below business logic...
Reply with quote

Purnendu.it wrote:
Hi All,

My requirement is like this.

Identify a particular field type say field1 from file1 and map them to proper record to output file file2 to field say field2.

Field1 Name (abbreviation) field2 name
Cost Centre (KS) ZIBGN
Employee ID (PK) ZIBIW

when moving the field1 to proper output record the prefix
(ie KS ,PK) has to be deleted so only trailing charecter can be moved.

Ther can be multiple field1 abbreviation in the input record.
e.g ‘KS1234,PK5678,DS9012’

The output file look like
ZIBGN0000000000000000051234
ZIBIW0000000000000000055678
..............................................

how to approach the business logic for this.Kindly let me know if anyone didnt got the requrement?

Thanks

Puru


I didn’t get the requirement and I have my doubts that you did either. Is this how you presented your solutions to the business user?

Purnendu.it wrote:


n i have done the logic but program just i wanted to check if there is any other ideas which i can get n which can be a better approach...

thnks!!
puru


Would love to see the actual requirement document and any supporting business case developed to support the solution developed. Can you post the “logic” that you developed for this home, ah, I mean business assignment?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Fri Oct 08, 2010 12:22 am    Post subject: Reply to: Help regarding below business logic...
Reply with quote

Quote:
Are you here to help people or pointing their fault? see my first post then you wil see i have written separate line for each input fields records.
n pls reply in a proper way or dont reply.thanks

we are here spending time on Your issues
we answer on our time, free of charge

and if we ask questions it to understand Your issues and try to give good answers to badly posed questions

and You should appreciate it
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 Need help in building a logic Benchwarmer All Other Mainframe Topics 4 Wed Feb 22, 2017 2:49 am
No new posts Business Rule extraction frozenblood CLIST & REXX 9 Tue Dec 27, 2016 10:06 am
No new posts Wildcard logic in COBOL dudenithy COBOL Programming 13 Thu Sep 01, 2016 7:36 pm
No new posts Sort Logic to extract data scorp_rahul23 DFSORT/ICETOOL 13 Tue Mar 01, 2016 1:22 am
No new posts Need a logic to validate the data in ... sandeep kumar302 COBOL Programming 17 Mon Feb 01, 2016 3:30 pm


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