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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 1479 views
  • 0 likes
  • 3 in conversation