I have a CAS in memory table which i want to save as a CSV file in the data source associated with the CASLIB. The tables have characters and numeric fields. I am running this code on SAS Studio in SAS Viya. Below is the code that I am using. Using PROC CASUTIL: proc casutil; save casdata="tablename" incaslib="caslib" outcaslib="caslib" casout="filename.csv" replace; run; Using PROC CAS: proc cas; table.save / table={name="tablename" caslib="caslib"} name="filename.csv" caslib="caslib" replace="yes"; run; Now in both the cases the result is same, i.e., the file is created as a CSV the numeric fields are coming properly without enclosing of quotes. But with the character fields, the character fields that have space in them are enclosed in quotes and the character fields without any space in them are not enclosed in quotes. Some thing like shown below: acct_num,org,cust_num,int_status,curr_bal,block_code 0004010391500712881,400,0004010391500646024,A,5000,F 0004010391500712882,400,0004010391500712883,D,700.5,L 0004010391500712883,400,0004010391500712883,D,0,L 0004010391500712884,400,0004010391500712883,D,1000,"" 0004010391500712885,400,0004010391500712883,D,1000,abcd 0004010391500712886,400,0004010391500712883,"",1000,abcd 0004010391500712887,400,0004010391500712883,"",1000,abcd Wherein the columns int_status and block_code are character fields. This seems like a very inconsistent behavior, or may be I am unaware of the reason. My requirement is that the character fields should be enclosed in double quotes or at the very least none of the characters fields are enclosed in quotes. I want to achieve uniformity in how a specific type of data is written. My preference is that the characters fields should be enclosed in double quotes. Is there is some option using which this can be achieved?
... View more