Page 1 of 1

Plz help me in this senario

Posted: Mon Sep 26, 2011 12:26 pm
by e1994264
How can we a shell script and pass date parameters .I have 3 files comming from Datastage with |" delimited

I need append 3 files as above: File1:

P0000|"47416954|"AU|"000|"INS|"0000|"|"20060601|"99991231|"|"|"|"|"01




File 2:

P0001|"47416954|"AU|"000|"INS|"0001|"|"20060501|"99991231|"|"|"|"|"4210|"4210|"1|"2S|"GB|"|"4211|"8M




File 3:

P0002|"47416954|"AU|"000|"INS|"0002|"|"20060601|"99991231|"|"|"|"|"ALLY-POLLARD|"|"LEILA|"|"LEILA|"00|"2|"2|"19760411|"GB|"|"1|"20040828|"|"|"|"JE397813B




After append 3 files i need add Header and trailer for the single file

Header Should have following inforamtion:

RECTYP|"CLientid|"Cleint Name|"email|"RunDate|"RunTime

Rundate:YYYYMMDD format need to be passed

Run Time: HHMMSS in 24 hour format should be passed



Trailer Record:

RECTYP|"RECORD COUNT



Sample output should be like this

HEADR|"GVAADP|"ID |"MANI|"|"OT20060403|"20060403|"050020


P0000|"47416954|"AU|"000|"INS|"0000|"|"20060601|"99991231|"|"|"|"|"01

P0001|"47416954|"AU|"000|"INS|"0001|"|"20060501|"99991231|"|"|"|"|"4210|"4210|"1|"2S|"GB|"|"4211|"8M

P0002|"47416954|"AU|"000|"INS|"0002|"|"20060601|"99991231|"|"|"|"|"POLLARD|"|"LEILA|"|"LEILA|"00|"2|"2|"19760411|"GB|"|"1|"20040828|"|"|"|"JE397813B

TRAIL|"3

Posted: Mon Sep 26, 2011 4:07 pm
by jhmckeever
Based on the values in your sample output you could simply funnel the rows and sort them alphabetically, although I suspect your ACTUAL requirement to be a little more subtle than that.