11-03-2017 12:36 AM
I'm trying to generate a set of random data and export then Numpy in Python environment can read and work on. So I would export the data without var label and learned below and code as attached with label x='00'x, but x is still there, see attached csv
data MYSECOND.BIRANDOM; call streaminit(1234); do i=1 to 100; x=rand("normal", 20, 3); /*y=0;*/ output; end; do i=101 to 200; x=rand("normal", 30, 3); output; /*y=0;*/ end; Drop i; run; proc print data=mysecond.birandom; var x; label x='00'x; run; /* Option group 5 (GRAPH SIZE) parameters. */ /*--Set output size--*/ ods graphics / reset imagemap; /*--SGPLOT proc statement--*/ proc sgplot data=mysecond.BIRANDOM; /*--Histogram settings--*/ histogram x / scale=COUNT SHOWBINS; /*--Vertical or Response Axis--*/ yaxis grid; run; /*ods graphics / reset; ods noproctitle; ods graphics / imagemap=on; proc princomp data=mysecond.BIRANDOM plots(only)=(scree); var x y; run;*/ /* Stream a CSV representation of SASHELP.CARS directly to the user's browser. */ proc export data=mysecond.birandom outfile="/folders/myfolders/MySimulation/birandom.csv" dbms=csv replace; label; run; %let _DATAOUT_MIME_TYPE=text/csv; %let _DATAOUT_NAME=birandom.csv;
Can someone advise where went wrong and how to fix it, thank you!
11-03-2017 03:16 AM
You want to create a CSV file without the header row?
Then just use a DATA step.
data _null_; set mysecond.birandom; file "/folders/myfolders/MySimulation/birandom.csv" dsd ; put (_all_) (+0); run;
11-03-2017 03:36 AM
..though I completely agree with @Tom that the best way to do it is with the FILE statement in the data step. But since you had already written an EXPORT procedure, this was probably the quickest and dirtiest fix
Need further help from the community? Please ask a new question.