打印带分隔符的所有列 SAS
Print all columns SAS with delimiter
我正在尝试打印一个带分隔符的文件,而不必指定所有列。我可以接近,但数字列总是被引用:
DATA _NULL_;
SET SASHELP.CARS (obs = 5 keep = Make Model EngineSize);
FILE "foo.csv" DSD DLM=",";
PUT (_all_) (~);
RUN;
foo.csv
"Acura","MDX","3.5"
"Acura","RSX Type S 2dr","2"
"Acura","TSX 4dr","2.4"
"Acura","TL 4dr","3.2"
"Acura","3.5 RL 4dr","3.5"
我怎样才能实现:
"Acura","MDX",3.5
"Acura","RSX Type S 2dr",2
"Acura","TSX 4dr",2.4
"Acura","TL 4dr",3.2
"Acura","3.5 RL 4dr",3.5
或:
Acura,MDX,3.5
Acura,RSX Type S 2dr,2
Acura,TSX 4dr,2.4
Acura,TL 4dr,3.2
Acura,3.5 RL 4dr,3.5
~
要求报价。因此,您正在引用。
您可以使用 &
代替:
DATA _NULL_;
SET SASHELP.CARS (obs = 5 keep = Make Model EngineSize);
FILE "c:\temp\foo.csv" DSD DLM=",";
PUT (_all_) (&);
RUN;
&
实际上对数据没有影响(我们曾经有过关于它的问题,我不记得最终的答案,但基本上它似乎主要用于此特定目的,即使那不是它的目的)。
我正在尝试打印一个带分隔符的文件,而不必指定所有列。我可以接近,但数字列总是被引用:
DATA _NULL_;
SET SASHELP.CARS (obs = 5 keep = Make Model EngineSize);
FILE "foo.csv" DSD DLM=",";
PUT (_all_) (~);
RUN;
foo.csv
"Acura","MDX","3.5"
"Acura","RSX Type S 2dr","2"
"Acura","TSX 4dr","2.4"
"Acura","TL 4dr","3.2"
"Acura","3.5 RL 4dr","3.5"
我怎样才能实现:
"Acura","MDX",3.5
"Acura","RSX Type S 2dr",2
"Acura","TSX 4dr",2.4
"Acura","TL 4dr",3.2
"Acura","3.5 RL 4dr",3.5
或:
Acura,MDX,3.5
Acura,RSX Type S 2dr,2
Acura,TSX 4dr,2.4
Acura,TL 4dr,3.2
Acura,3.5 RL 4dr,3.5
~
要求报价。因此,您正在引用。
您可以使用 &
代替:
DATA _NULL_;
SET SASHELP.CARS (obs = 5 keep = Make Model EngineSize);
FILE "c:\temp\foo.csv" DSD DLM=",";
PUT (_all_) (&);
RUN;
&
实际上对数据没有影响(我们曾经有过关于它的问题,我不记得最终的答案,但基本上它似乎主要用于此特定目的,即使那不是它的目的)。