Can SAS convert CSV files to binary?

The output we need to create is a standard delimited file, but instead of the contents of ascii, we need a binary file. Is it possible to use SAS?

+3
source share
4 answers

In fact, you can create a CSV file as an SAS directory entry; CSV is a valid type of SAS directory entry.

Here is an example:

filename of catalog "sasuser.test.class.csv";

proc export data=sashelp.class
   outfile=of
   dbms=dlm;
   delimiter=',';
run;

filename of clear;

This small piece of code exports SASHELP.CLASS to a SAS directory entry of type CSV type.

, SAS PROC CPORT/CIMPORT, , SAS, SAS-.

+1

? - -ascii? proc, , , . csv .

- , csv.

, * nix, - :

filename outfile pipe "gzip -c > myfile.csv.gz";

csv :

data _null_;
   set mydata;
   file outfile;
   put var1 "," var2 "," var3;
run;

PC/Windows SAS, , , , zip .

SAS winzip, . . http://support.sas.com/kb/26/011.html

+4

, , csv?

If this is the case, I do not think that there must necessarily be a certain standard for how this should be handled.

I suggest trying it (export proc comes to mind) and they see if the results meet your expectations.

+1
source

Using SAS, output the .csv file; Open it in Excel and save as any format your client wants. You can automate this process with a few scripts in ###. (Substitute ### with your favorite scripting language.)

0
source

Source: https://habr.com/ru/post/1712204/


All Articles