@Harish2 wrote:
Hi team,
I am extracted the data and exporting into .dat format with pipe delimiter after exporting i am getting some extra pipes in the file.Please let me know how to remove that extra pipes while doing export.
Example :PIUM_FC |MS|PIUM_MRSC|CO|PIUM_LBC|HCT|PIUM_ATC|PM|MC_CNT1|13||||
Thanks,
Harish
Those "extra pipes" are likely not extra but are related to the last 4 variables exported having missing values.
If they represent variables you do not actually want in the output then DROP them from the export step, if using proc export. If using a data step then don't write them.
Example:
data example;
x= 'something';
y=.;
z=.;
run;
proc export data=example outfile='x:\data\example.txt'
dbms=dlm replace;
delimiter='|';
putnames=yes;
run;
results in
x|y|z
something||
the first "extra" pipe is between X and Y, the second between Y and Z variables.
If later rows of the data set have values for Y and Z they would appear.
More entertaining would be what you would do with "extra" pipes if the X value is missing but Y and Z aren't. If you removed the "extra" leading pipe the value of Y would be treated as that for X in whatever happens next.
With probability approaching unity you likely want to keep those pipes.
If not you will need to explain exactly what gets broken when they are present with missing values.