Greetings,
1. I'm using PROC IMPORT CSV with Guessing Rows = MAX to read a CSV File in Enterprise Guide.
2. I have 2 DateTime columns which has some issues. After execution is done, the dataset is being created, but I get error message.
3. Ideally, I would like to make the system to ignore the error message. I'm accepting the fact that some of the rows will be with missing data.
4. Details Below:
4.1. Code:
4.2. Error Message (rows created BUT error message with import unsuccessful):
4.3 Results in Guide:
5. Could you please assist?
Thanks!
Daniel
You NEVER ignore ERRORs or WARNINGs, you correct them.
With CSV files, write the data step yourself instead of relying on the guesses of PROC IMPORT.
As a starter, copy the code created by IMPORT from the log and modify it.
Look what is in the file that causes the issues, and provide for it in the code. It might also be that you detect genuine faulty data that needs to be reported to the source.
For detailed help, provide an example of the csv file, including the header, "clean" data and a line that causes the ERROR.
You NEVER ignore ERRORs or WARNINGs, you correct them.
With CSV files, write the data step yourself instead of relying on the guesses of PROC IMPORT.
As a starter, copy the code created by IMPORT from the log and modify it.
Look what is in the file that causes the issues, and provide for it in the code. It might also be that you detect genuine faulty data that needs to be reported to the source.
For detailed help, provide an example of the csv file, including the header, "clean" data and a line that causes the ERROR.
Show the entire LOG of anything generating errors. From the log copy the text of the code along with any notes, messages, warnings or errors. On the forum open a text box using the </> above the message window. PASTE the text.
It is much easier to make suggestions to code if we can copy and edit text.
You show nothing related to any specific variables, datetime or otherwise. So why are you referencing them?
If you have invalid data in the column for them I would expect to see different output in the log, such as INVALID data notes. Generally that means your data has values that are not valid datetime (or date or time) values but would not result in the type of error you show.
Hi all,
Thanks to your advise, this was solved! This is the process i've done:
1. I've ran proc IMPORT CSV --> Got Error
2. I've copied the Data Step from the log
3. I've changed all the problematic fields to be characters
4. I've ran the data step to successfuly create a SAS Dataset
5. I've then did some modification to the problematic columns with compress function
Your help is much appreciated!
D
If you have columns in there that contain dates, times, datetimes or any other kind of numeric data, then do not read them as character, or only read them as character if the conversion to numeric takes more action than a custom informat can do.
You can't use character variables in calculations.
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!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.