BookmarkSubscribeRSS Feed
huikeng_sas
SAS Employee
Hi,

If my raw data file (csv or fixed length file) contains column headings in the first row, can I use a infile, input statement to read in the column headings as my sas variable names?

Thanks!
4 REPLIES 4
Doc_Duke
Rhodochrosite | Level 12
You can in EGuide. I'm not sure if it is easy to do in base SAS.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
What OS is SAS running under - can you use PROC IMPORT?

Scott Barry
SBBWorks, Inc.
huikeng_sas
SAS Employee
If customer didnt license Acc to PC File Formats, he will not be able to use proc import. So, is there a way that he can work around using infile, input statements without specifying the column names in the input statements?

Thanks!
Peter_C
Rhodochrosite | Level 12
Nicole

except on zOS MVS-type mainframes

for a raw file, the SAS EFI accessed on the main SAS File-menu option Import-Data (aka "Import wizard" which uses proc import when needed) can help, even without licensing SAS/ACCESS to PC file formats.
I prefer a data step (simple example at http://support.sas.com/forums/thread.jspa?messageID=13449㒉 ), but you get more support and prompting from EFI.

If you need prompt support, SAS Enterprise Guide is even better. See that forum at http://support.sas.com/forums/forum.jspa?forumID=10 .

Because of the restrictions that apply to variable names, I don't dynamically load these names, just paste the list from the file into my program and use the editor to "clean up" the problems

PeterC Message was edited by: Peter.C (who forgot not all platforms have SAS EFI and proc import)

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 4 replies
  • 1547 views
  • 0 likes
  • 4 in conversation