HI Siva,
Try this
option obs=10;
proc import datafile='C:\shiva\not.csv'
out=work.mydata
dbms=csv
replace;
datarow=5;
getnames=yes;
run;
After the execution of the above code reset the option by
option obs=max;
thank you for responding, without using global option we cannot read part of the data form the csv file, and we cannot use range statement inside the proc import step WHY ?
at last my question is why Range statement is not working in the CSV importing file
shiva
Because a CSV has a flat file structure, and does not have sheets and cells. An Excel workbook has this information included in it's "metadata".
Do you really need to use proc import?
I typically use Datasteps to import delimited files. I created a sample CSV which contains 4 variables and imported only 3 of them using the ffollowing:
DATA WORK.TEST;
LENGTH
STUFF1 $ 6
STUFF3 $ 5
STUFF4 $ 9 ;
FORMAT
STUFF1 $CHAR6.
STUFF3 $CHAR5.
STUFF4 $CHAR9. ;
INFORMAT
STUFF1 $CHAR6.
STUFF3 $CHAR5.
STUFF4 $CHAR9. ;
INFILE 'E:\BOOK1.CSV'
FIRSTOBS=2
LRECL=29
ENCODING="WLATIN1"
TERMSTR=CRLF
DLM=","
MISSOVER
DSD ;
INPUT
STUFF1 : $CHAR6.
STUFF3 : $CHAR5.
STUFF4 : $CHAR9. ;
RUN;
Is this useful?
Regards,
Scott
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.