Filtering a numeric column name in SAS SQL (1 Viewer)

Ben_Entrew

Registered User.
Local time
Yesterday, 17:29
Joined
Dec 3, 2013
Messages
177
Hi all,

I was trying to select a reporting month column from table temp_trans, it looks like:
GPNr 202112 202201 202202 .... 202208
x 1 5 2 ... 3
y 0.4 2 3 8
z 3 1 5 ... 6

Code:
proc sql noprint;
  select distinct Berichtsmonat into :timeperiod1 - FROM work.Basis;

quit;

%put & timeperiod1
---> 202112

Now I was trying to apply a condition on the 202112 column:

Code:
PROC SQL;
   CREATE TABLE WORK.QUERY_FOR_TEMP_TRANS_0000 AS
   SELECT t1.*
      FROM WORK.TEMP_TRANS t1
      WHERE t1.&timeperiod1 NOT = .;
QUIT;

I get following a synthax error message for t1.202112 .
It runs when I make out of it : where t1.'202112'n not = .;

Any clue how I can get fixed this?
Thanks in advance.

Kind regards,
Ben
 
Last edited:

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 01:29
Joined
Jul 9, 2003
Messages
16,282
I noticed that you have yet to receive a reply to your question, hence I am bumping it up the list so that it gets another look. Let's hope you get lucky...!!!
 

Users who are viewing this thread

Top Bottom