libname cert 'C:\SAS data and program\data\data set used in OG of SAS base\cert';
%let Location = USA;
data work.FlightEmpData;
set Cert.empdata cert.empdatu cert.empdatu2;
where Country = "&Location" and Salary >= 30000;
run;
proc sort data = work.FlightEmpData;
by descending Salary;
run;
proc export data = work.FlightEmpData
outfile = 'C:\SAS data and program\program\10 scenarios of sas base OG\FlightEmpData.csv'
dbms = csv
replace;
run;
the code above generate a .csv file , like excel , like the following :
but the answer on the textbook : (it's a notepad)
how to generate a notepad as the answer on the book ?
Right-click on the file
select propertises
click Change...
select notepad
select Ok
select apply
This method works.
Thank you all for your helps.
Open the file with Notepad instead of Excel. Right-click, select "Open with", and then Notepad (or another text editor).
A CSV file is a text file. Why post a photograph text? Why not just post the text from the file? For example from the command line just use the DOS type command to display the text of the file. Or open the file with a text editor like notepad and then copy and paste the lines of text.
Be very careful opening a CSV with Excel as Excel will transform some of the text in the file based on its assumptions. For example strings with digits separated by hyphens might get converted into a date value by Excel.
Right-click on the file
select propertises
click Change...
select notepad
select Ok
select apply
This method works.
Thank you all for your helps.
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.