BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
buckeyefisher
Obsidian | Level 7

I am using EG 4.3. I have a field heading 'Date Founded'  (it has a space in between) that contains dates in the input excel sheet. I am not supposed to touch the input excel sheet.

Is there a way to access this field in SAS EG? I tried VALIDVARNAME = ANY option to ignore spaces but my data step is not recognizing the field. The program does not give error, simply ignores calculation in the data step.

1 ACCEPTED SOLUTION

Accepted Solutions
dsbihill
Obsidian | Level 7

You can access the variable by typing it like this.  This will tell sas that it is a name litteral.

'Date Founded'n

View solution in original post

4 REPLIES 4
ballardw
Super User

How did you bring the data into SAS? Proc import if using the file column headers to provide variable names generally turn all spaces and special characters to underscores. I would expect the variable name to be Date_founded.

buckeyefisher
Obsidian | Level 7

no, it did not convert the input fields, I used proc import

proc import datafile= 'file A'

  dbms=xls out=A replace;

  sheet="xyz";

run;

RW9
Diamond | Level 26 RW9
Diamond | Level 26

I would suspect then as you don't have getnames=yes; option, that it has been read in using default names for the columns, e.g. col1 col2 etc.

dsbihill
Obsidian | Level 7

You can access the variable by typing it like this.  This will tell sas that it is a name litteral.

'Date Founded'n

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
  • 16376 views
  • 5 likes
  • 4 in conversation