BookmarkSubscribeRSS Feed
Marcio1
Calcite | Level 5

Bom dia. Alguém poderia ajudar?

 

 

Estou  tentando rodar o rotina:

 

proc sql noprint;

select max(input(scan(scan(arquivo,1,'.'),-1,'_d'),yymmddn8.)) as dt_ref into: dt_copia
from work.out_ls
where pasta eq './' and arquivo contains "cluster_encer";

;run;

%put &dt_copia;

proc sql;
create table ENCERRADA as
select *
from canal.cluster_encer_&dt_copia
;
quit;

 

 

Mas está tendo os erros:

 

 

ERROR: The informat YYMMDDN was not found or could not be loaded.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect.
WARNING: Apparent symbolic reference DT_COPIA not resolved.
&dt_copia
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
NOTE: Line generated by the invoked macro "SEUDIA".
4278 create table ENCERRADA as select * from canal.cluster_encer_&dt_copia ;
                                                                                                             _
                                                                                                            22
                                                                                                           200
WARNING: Apparent symbolic reference DT_COPIA not resolved.
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, (, ',', ANSIMISS, AS, CROSS, EXCEPT, FULL, GROUP, HAVING,
INNER, INTERSECT, JOIN, LEFT, NATURAL, NOMISS, ORDER, OUTER, RIGHT, UNION, WHERE.

ERROR 200-322: The symbol is not recognized and will be ignored.

2 REPLIES 2
PaigeMiller
Diamond | Level 26

ERROR: The informat YYMMDDN was not found or could not be loaded.

 

There is no such informat YYMMDDN. Here is a list of all known informats: https://documentation.sas.com/?cdcId=pgmmvacdc&cdcVersion=9.4&docsetId=allprodslang&docsetTarget=syn...

 

 

So your macro variable DT_COPIA never gets assigned a value, it does not exist.

--
Paige Miller
Tom
Super User Tom
Super User

SAS does have a FORMAT named YYMMDDN, but as the error message says there is no INFORMAT with that name.  You can use the YYMMDD informat to read strings of digits that represent dates in year month day order.   Also do you want the macro variable to contain the unformatted date value?  Or do you want it to contain the original string that looks like a date in YYYYMMDD order?  If the later you could probably just treat it as a number instead of date.  That is one of the advantages of using Y-M-D ordered strings.  They sort properly when treated as text, or raw numbers.

 

Since the first error caused the SQL query to fail the macro variable is not generated which leads to your later error.

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
  • 2 replies
  • 341 views
  • 0 likes
  • 3 in conversation