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.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 796 views
  • 0 likes
  • 3 in conversation