I have tried the answer on this topic:
But then i get 4 quotes around my values like """"value""""|"""""column2"""""|"""""""""|
proc sql;
create view work.W2MFNVH as
select
(strip(put(VEQUNR3,30.))) as Connection_GlobalID length = 30
format = $30.,
VSTREET as Street,
VHOUSEN1 as HouseNumber1,
VHOUSEN2 as HouseNumber2,
VCITY as Municipality,
(compress(ZGPSCOORY)) as XCoord length = 20
format = $20.
label = 'Aansl e gps coordinaat x',
(compress(ZGPSCOORX)) as YCoord length = 20
format = $20.
label = 'Aansl e gps coordinaat y'
from &SYSLAST
;
quit;
%let SYSLAST = work.W2MFNVH;
options missing='';
data _null_;
set &SYSLAST;
attrib Connection_GlobalID length = $30
format = $30.;
attrib Street length = $60
format = $60.;
attrib HouseNumber1 length = $10
format = $10.;
attrib HouseNumber2 length = $10
format = $10.;
attrib Municipality length = $40
format = $40.;
attrib XCoord length = $20
format = $20.;
attrib YCoord length = $20
format = $20.;
quote='"';
file "&aa_path.reload.coordinatesdn.&ts..del" dlm='|' DSD;
if ( _n_ = 1 ) then
do;
put
"Connection_GlobalID|Street|HouseNumber1|HouseNumber2|Municipality|XCoord|YCoord";
end;
put
quote +(-1) Connection_GlobalID +(-1) quote
quote +(-1) Street +(-1) quote
quote +(-1) HouseNumber1 +(-1) quote
quote +(-1) HouseNumber2 +(-1) quote
quote +(-1) Municipality +(-1) quote
quote +(-1) XCoord +(-1) quote
quote +(-1) YCoord +(-1) quote
;
run;
Please use a code window, its the {i} above the post area. Why are you using &SYSLAST throughout and manually setting it at one point, this is not the way to program in SAS.
As for your question:
options missing=''; data _null_; set work.w2mfnvh; file "&aa_path.reload.coordinatesdn.&ts..del" dlm='|' dsd; if _n_=1 then put "Connection_GlobalID|Street|HouseNumber1|HouseNumber2|Municipality|XCoord|YCoord"; put connection_globalid street housenumber1 housenumber2 municipality xcoord ycoord; run;
What does the above not do? The output file generated there is fine and compliant delimited text - file extension fine!. You only need quotes if the data contains the delimiter, which if it does then change the delimiter.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.