Page 1 of 1

Spliting one record in to two records of output file

PostPosted: Wed Jul 11, 2012 10:53 pm
by gotobaskar
I have a record in the input file in the below format
BASIC SALARY = BS
VARIABLE ALLOWNANCE = VA

ID - 3 BYTE, NAME - 10, DESIGNATION - 15, BS - 6, VA - 6

ID NAME DESIGNA BS VA

ABA;KUMAR;DEVELOPER;10000;15000
ABC;MURAL;SUPERVISOR;9000;14000
AB0;DILIP;ENGINEER;6000;12000
AB1;ANAND;ASSISTANT;7000;13000
111;SUDHA;CONSULTANT;12000;20000

OUTPUT FILE SHOULD BE (Have to achieve it through SORT/ICETOOL)

AB0;DILIP;ENGINEER;CONSULTANT
ABA;KUMAR;DEVELOPER;CONSULTANT;10000
ABA;KUMAR;DEVELOPER;CONSULTANT;15000
ABC;MURAL;SUPERVISOR;CONSULTANT;9000
ABC;MURAL;SUPERVISOR;CONSULTANT;14000
AB1;ANAND;ASSISTANT;CONSULTANT;7000
AB1;ANAND;ASSISTANT;CONSULTANT;13000

Scenario / Rules to generat Output : One record in the input file has to be splitted to many and also one field value of the output record has to be picked from other input records..

Brief description of the output file below,

AB0;DILIP;ENGINEER;CONSULTANT ---> First output record
In the above First record, forth field value picked from the last record( key field has 111)
ABA;KUMAR;DEVELOPER;CONSULTANT;10000 --> Second output record
ABA;KUMAR;DEVELOPER;CONSULTANT;15000 --> Third output record

The above second and third records splited from the first record from the input file.
First record of the output file has CONSULTANT from the last record key field has 111 and Basic salary fom input file
Secomd record of the output file has CONSULTANT from the last record key field has 111 and Variable allowance fom input file

Kindly, help me out to get the result.

thanks,
Baski

Re: Spliting one record in to two records of output file

PostPosted: Wed Jul 11, 2012 11:03 pm
by Akatsukami
Please justify your "having" to perform this with DFSORT/ICETOOL.

Re: Spliting one record in to two records of output file

PostPosted: Wed Jul 11, 2012 11:25 pm
by gotobaskar
Sorry Akatsukami, I didn't get u...I have to do this thru sort instead of writing a program....Please advic me, is this possible in SORT

Re: Spliting one record in to two records of output file

PostPosted: Wed Jul 11, 2012 11:29 pm
by Akatsukami
Please explain why this must be done with DFSORT rather than by a program that you have written. Is this homework or a programming class assignment?

Re: Spliting one record in to two records of output file

PostPosted: Wed Jul 11, 2012 11:33 pm
by gotobaskar
No, It's a requirement...not a homework or assignment

Re: Spliting one record in to two records of output file

PostPosted: Thu Jul 12, 2012 12:00 am
by dick scherrer
Hello,

The "requirement" is to support the business function - Not the tool used to reach the desired output.

If someone is so insistent that you must use your sort product, they need to provide the information you need to implement. . .

In order to implement using any tool or language, i believe the requirement needs to be more clearly presented. . . at least for me to understand.
First record of the output file has CONSULTANT from the last record key field has 111 and Basic salary fom input file
Why? Same question regarding the second record . . .

You should not implement a solution that you will have no idea how to maintain. . .

Re: Spliting one record in to two records of output file

PostPosted: Thu Jul 12, 2012 2:28 am
by skolusu
gotobaskar,

It is not clear as to how the match is done. You need to do a better job of explaining your requirements.


1. How did the 3rd record frominput end up as 1st record in the output? What is the SORT criteria?

2.How do you identify the Key field 111? is it always the last record in the file? and does it always have 111 in the first 3 byes?

3. Why is AB0;DILIP;ENGINEER;CONSULTANT a special record in the output when every other record has either BASIC SALARY or VARIABLE ALLOWNANCE in the 5th field?

4. What is the LRECL and RECFM of the input and output files?