Write output on a condition in SORT.
Posted: Mon Sep 12, 2016 3:31 pm
I have a file which has got fields in it. Two fields are like department and somme other description. All the records has same department name but description part is populated only once for a given department. So the input will look like the following example:
Now my SORT should write only that record in the output which has got some description. In most of the case one of the records will have a description. In case if all the records don't have any description than any one of the record can be put in the output.
My input is FB and LRECL is 80. Output should be of same attributes. The Department can be repeated 5 times and 5 bytes long. Description is 10 bytes long. Can soomeone please help me on this.
Coded for your
Code: Select all
-----5----------------15
Dept1
Dept1
Dept1 description1
Dept1
Dept1
Dept2
Dept2
Dept2 description2
Dept2
Dept2
Now my SORT should write only that record in the output which has got some description. In most of the case one of the records will have a description. In case if all the records don't have any description than any one of the record can be put in the output.
My input is FB and LRECL is 80. Output should be of same attributes. The Department can be repeated 5 times and 5 bytes long. Description is 10 bytes long. Can soomeone please help me on this.
Coded for your