BookmarkSubscribeRSS Feed
Sandyc
Calcite | Level 5

Hi,

CSV file that I'm trying to read into SAS university edition contains 107 variables. The variable names start with var3 and end with var189 .

When I used the following code,

proc import datafile="/folders/myfolders/sample.csv" out=sample1

        dbms=csv replace; getnames=yes; ;

run;

the variable names in the output data set change completely. The sequence of variable names start with var1 and ends with var189 but has 107 variables like the input CSV file.

I tested this using:

proc contents data=sample1;

run;

I'm not sure as to why the variable names change. That is instead of var3 as the first variable name, it shows as var1.

Please help to understand the reason and I tried changing the input file format, but I still come across the same problem with the variable names.

The bottom line is whatever variable names displayed in the input file should appear in the output dataset also.

2 REPLIES 2
GraphGuy
Meteorite | Level 14

In your csv file, are the variable names in the very first row? (or is there possibly a blank row in the file before the variable names?)

 

Reeza
Super User
Can you post the first few lines of your file?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 677 views
  • 0 likes
  • 3 in conversation