DATA _NULL_;
SET TEMP.LATEST_BAL_DATE;
DT3=PUT(MAX_BAL_DATE,DATE9.);
CALL SYMPUT("BALDT_DATE9",DT3);
RUN;
%LET BALDT_DATE9=%STR(%')&BALDT_DATE9.%STR(%'D);
%PUT &BALDT_DATE9.;
PROC SQL;
CREATE TABLE TEST_TEMP AS
SELECT * FROM
SASD.CBOL_DEP_APPLICATIONS_20171122
WHERE SESSION_DATE_AT_APPSTART <= &BALDT_DATE9.
;
QUIT;
Log:-
21 DATA _NULL_; 22 SET TEMP.LATEST_BAL_DATE; 23 DT3=PUT(MAX_BAL_DATE,DATE9.); 24 CALL SYMPUT("BALDT_DATE9",DT3); 25 RUN;
NOTE: There were 1 observations read from the data set TEMP.LATEST_BAL_DATE. NOTE: DATA statement used (Total process time): real time 0.58 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds memory 536.00k OS Memory 18336.00k Timestamp 11/27/2017 11:01:22 PM Step Count 67 Switch Count 36 Page Faults 0 Page Reclaims 92 Page Swaps 0 Voluntary Context Switches 124 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0
26 27 %LET BALDT_DATE9=%STR(%')&BALDT_DATE9.%STR(%'D); SYMBOLGEN: Macro variable BALDT_DATE9 resolves to 22NOV2017 28 %PUT &BALDT_DATE9.; SYMBOLGEN: Macro variable BALDT_DATE9 resolves to '22NOV2017'D SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. '22NOV2017'D 29 30 PROC SQL; 31 CREATE TABLE TEST_TEMP AS 32 SELECT * FROM 2 The SAS System 21:18 Monday, November 27, 2017
33 SASD.CBOL_DEP_APPLICATIONS_20171122 34 WHERE SESSION_DATE_AT_APPSTART <= &BALDT_DATE9. SYMBOLGEN: Macro variable BALDT_DATE9 resolves to '22NOV2017'D SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. 35 ; NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements. NOTE: Line generated by the macro variable "BALDT_DATE9". 35 '22NOV2017'D _ 22 _ 200 ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant, a missing value, (, +, -, ALL, ANY, BTRIM, CALCULATED, CASE, INPUT, PUT, SELECT, SOME, SUBSTRING, TRANSLATE, USER.
ERROR 200-322: The symbol is not recognized and will be ignored.
... View more