Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 9405

DFSORT/ICETOOL :: Next max

$
0
0
Author: kgumraj2
Subject: Next max
Posted: Thu Jun 16, 2016 10:50 am (GMT 5.5)

Hi,
I searched forums but could not find. Could you please help me.

I have a input file with below layout

Code:
CLIENT-1   2016-01-01   HMO
CLIENT-2   2016-01-01   090
CLIENT-2   2016-02-01   520
CLIENT-2   2016-02-03   HMO
CLIENT-2   2016-03-01   
CLIENT-2   2016-04-01   520
CLIENT-2   2016-05-01   090

( Imagine: cleint filed is 8 char, date is 10 char, client_ty is 3 charaters and file is sorted on client, date ( asec))

when the 3rd field is has spaces, the output has to be like this

Code:
CLIENT-1   2016-01-01   HMO   NS
CLIENT-2   2016-01-01   090   NS
CLIENT-2   2016-02-01   520   NS
CLIENT-2   2016-02-03   HMO   NS
CLIENT-2   2016-03-01   520   SP
CLIENT-2   2016-04-01   520   NS
CLIENT-2   2016-05-01   090   NS

That is next client_ty of that client has to be updated ( in this case 520) and 4th field should be SP ( means spaces) and for non spaces ( NP).
In case we have spaces and there is only one record for that client, we have to update HMO and 4th field as SP

Kindly help me on this. Thanks

code' d
_________________
Have a Great Day !!!
Kiran G R


Viewing all articles
Browse latest Browse all 9405

Trending Articles