Help using Base SAS procedures

IMPORT particular columns and rows only

Reply
Contributor
Posts: 31

IMPORT particular columns and rows only

Hi ,

I have an excel file which looks like below A1 and it has data from A TO G  and i want to create a sas dataset A2  which has A TO C coloumns only and also from row3  Can anyone pls help

 

 

A1 (EXCEL)

sales01sales01sales01sales04sales05sales06sales07
PSCVCC    
IDitem1item266    
0236456    
0236456    
1321333    
2254222    

 

 

A2 (SAS DATASET)

IDitem1item266
0236456
0236456
1321333
2254222
Super User
Posts: 17,748

Re: IMPORT particular columns and rows only

What version of SAS are you using? Have you tried specifying the Range option? You will need to know the exact range ahead of time though. 

Super User
Posts: 3,101

Re: IMPORT particular columns and rows only

If your column headings don't change you could import exactly the columns you require using the LIBNAME statement with the EXCEL engine (assuming you have SAS/ACCESS to PC Files) and using a DATA step or SQL.

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