Help using Base SAS procedures

col names

Reply
Occasional Contributor
Posts: 14

col names

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

Grand Advisor
Posts: 9,458

Re: col names

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;

Occasional Contributor
Posts: 14

Re: col names

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......................

Frequent Contributor
Posts: 101

Re: col names

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;

Ask a Question
Discussion stats
  • 3 replies
  • 181 views
  • 0 likes
  • 3 in conversation