BookmarkSubscribeRSS Feed
sasemp999
Calcite | Level 5

hai
i am having sas 8.2 version
i am facing some problems when importing data into sas

options  nosymbolgen noMLOGIC;   
filename read "c:\abc.csv";
data new1;
infile read  MISSOVER  DSD firstobs=2 LS=32767;
informat    
var1     $CHAR40.;
input
var1
var2;
format 
var1     $CHAR40.;
run;

data new2;
set new1;
label  var1='start date of dosage date(yymmdd10.)';
run;


first i imported data by using var1,var2,.........................
after getting data into sas i used label for getting column names more than 32 chars ,some specail chars


Is there any way to get column names directly from raw files into sas?
i used options validvarname=any but it is not working in sas 8.2

3 REPLIES 3
Ksharp
Super User

I am not sure whether the following code could be working ,since I can't test it.

options validvarname=any;

proc import datafile='c:\abc.csv' out=want dbms=csv replace;getnames=yes;run;

sasemp999
Calcite | Level 5

thanku ksharp

proc import datafile='c:\abc.csv' out=want dbms=csv replace;getnames=yes firstobs=8;run;

i want data from 8 th row

but  it is getting error......................

FloydNevseta
Pyrite | Level 9

sasemp999 wrote:

thanku ksharp

proc import datafile='c:\abc.csv' out=want dbms=csv replace;getnames=yes firstobs=8;run;

i want data from 8 th row

but  it is getting error......................

Try datarow=8 instead of firstobs.

proc import datafile='c:\abc.csv' out=want dbms=csv replace;

     getnames=yes;

     datarow=8;

run;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 3 replies
  • 795 views
  • 0 likes
  • 3 in conversation