BookmarkSubscribeRSS Feed
FourLeafCLover
Calcite | Level 5

Hello all, I have imported a CSV file into SAS using a "read in" file that specifies variable names formats and values. I have imported this file in the past without issues. Today I imported an updated version of this csv file (exported from RedCap) using the same "read in " file. This time SAS is assigning the "values" to variables instead of the raw numbers. For example a dichotomous variable that is supposed to have either 0 or 1 raw value is actually assigned its "values" (I.e. "No" or "Yes") instead of its raw numbers (0,1).

 

Yesterday (and previous times), this was not the case.  Yesterday I imported an older version of this CSV file (CSV-file A) without issue, manipulated a few things is SAS and tried to export this SAS file into a new CSV file (CSV-file B). I had issues with this export with the data values which I posted about earlier. Today I imported an updated version of the CSV-A file  (CSV-file C) which is when the data value issue suddenly came up in SAS. Does anybody know what might be going on.

Thanks

 

7 REPLIES 7
Reeza
Super User
What you're describing isn't possible with a 'read in' file, if by that you mean a DATA STEP that imports your data with fixed names and formats.
When you run a PROC CONTENTS on the data set is the underlying data still there with a format applied or is the data itself just Yes/No?
If it's the latter, I suspect your data feed is problematic.

I'm assuming you've confirmed the data in the file itself has not changed?

If you're new to SAS is there any chance with all this fiddling that you've overwritten files? Can you confirm that the original source files have not been modified in any manner?


SASKiwi
PROC Star

@FourLeafCLover  - This appears to be the same problem you posted earlier. If you needed to clarify your original problem then you should have added to that post and not started a new one.

 

Please post the SAS log of your problem, including any DATA step code generated by PROC IMPORT. We can't easily help you if you don't provide evidence.

ballardw
Super User

Show the coded used to read the data.

Better, copy from the log the data step used to read the csv along with all notes and messages, paste into a text box opened on the forum with the </> icon.

Tom
Super User Tom
Super User

From your description here are some things to check.

  • Make sure that you are reading the correct file. It sounds like you are reading back in the file you wrote from SAS instead of the original file generated from Redcap.
  • Make sure that you are exporting the file from Radcap in the same way. Perhaps you selected a different option that cased the file to be create with the decoded values instead of the raw codes.

 

FourLeafCLover
Calcite | Level 5


<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
P {margin-top:0;margin-bottom:0;}



Thanks ballardw, unfortunately there are 40,000 lines in the log file. Cheers



Tom
Super User Tom
Super User

It takes 40,000 lines for just the data step that is reading the text file?

How many variables does this dataset have?

Reeza
Super User
Your log then has a lot of notes or errors that you need to resolve. Post the first set of errors/notes and then work your way through them.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 1060 views
  • 0 likes
  • 5 in conversation