proc import datafile='/home/u35263349/Product Sales_Candidate Attach 1_PresSE_013.csv'
out=ff.product_sales
dbms=csv;
delimiter=',';
guessingrows=max;
run;
1. I am struggling above error in sas on demand studio please find below csv attachment file
The file appears to be using a Carriage Return character to end the lines in the file. I think from your syntax that you are running your code in SAS On Demand which is a Linux implementation and expects either a Line Feed or can use the Windows CRLF line terminator.
Try
filename in "/home/u35263349/Product Sales_Candidate Attach 1_PresSE_013.csv" Termstr=CR; proc import datafile=in out=product_sales dbms=csv; delimiter=','; guessingrows=max; run;
Proc Import doesn't support the Termstr= option directly but the Filename does. So you can add that option as above.
Do you see where it says "no data in first 5 records"? Please investigate that.
As I recall, when you run PROC IMPORT on a CSV file, SAS creates code and executes it and this code and other error messages appears in the log. But you don't show us that code in the log. Show us.
That's it, no additional parts of the log?
The file appears to be using a Carriage Return character to end the lines in the file. I think from your syntax that you are running your code in SAS On Demand which is a Linux implementation and expects either a Line Feed or can use the Windows CRLF line terminator.
Try
filename in "/home/u35263349/Product Sales_Candidate Attach 1_PresSE_013.csv" Termstr=CR; proc import datafile=in out=product_sales dbms=csv; delimiter=','; guessingrows=max; run;
Proc Import doesn't support the Termstr= option directly but the Filename does. So you can add that option as above.
A SELECT statement in SQL must contain a FROM clause.
Do NOT use PROC IMPORT for text files, write your own data step where you have full control over all names and attributes.
@BrahmanandaRao wrote:
it is csv file only
Which you read with a DATA step, period.
options validvarname = V7;
filename psales "/home/u35263349/Product Sales_Candidate Attach 1_PresSE_013.csv" termstr=cr;
proc import file=psales dbms=csv out=product_sales_ds replace;
run;
issue is blanks within variables names please find attachment
Please READ my posts. Do NOT use PROC IMPORT.
@BrahmanandaRao wrote:
options validvarname = V7; filename psales "/home/u35263349/Product Sales_Candidate Attach 1_PresSE_013.csv" termstr=cr; proc import file=psales dbms=csv out=product_sales_ds replace; run;
issue is blanks within variables names please find attachment
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.