I don't recommend anything but informing the recipient(s) of your exported data how to use it.
Documentation is not optional in a professional environment, it is required.
What does "cut the columns successfully" actually mean?
If you are worried about the position, i.e. creating fixed column data, then Export is not what you should use.
@Ronein wrote:
I dont need extra quotes but I afraid that without it the TXT(or CSV file) will not cut the columns successfully. What do you think?
@Ronein wrote:
I dont need extra quotes but I afraid that without it the TXT(or CSV file) will not cut the columns successfully. What do you think?
To know whether or not the file can be properly read by some particular tool we need to know what tool you are using. Most tools can read CSV files properly. Most can also read similar files made with an other delimiter (in fact in a lot of countries that use comma as the decimal point indicate they routinely use semicolon as the delimiter instead of comma in "CSV" files).
I dislike using TAB as the delimiter in files because it makes the file hard to look at. And also if you open the file with a text editor it might replace the tabs with spaces to align the text to the next traditional tab stop and make the file unreadable.
If your data has a lot of commas (perhaps it has long descriptive text strings or using COMMA or DOLLAR format on some largish numbers) then I would use | as the delimiter.
Use a different extension on the file's name so that it does not accidentally get opened by whatever tool your machine is set to default to when it sees a CSV file. The name of the file has NOTHING to do with the content. It is just a suggestion to help the user make a quick judgement of what it MIGHT be.
proc export data=have file='myfile.txt' dbms=csv ;
delimiter='|';
run;
DBMS= is an OPTION on PROC EXPORT. DBMS=CSV, DBMS=DLM and DBMS=TAB all generate the exact same type of TEXT file. The only difference is the DEFAULT delimiter that is used. You can override the default by including the DELIMITER= statement.
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.