BookmarkSubscribeRSS Feed
Juli13
Fluorite | Level 6
options mprint mlogic;
%macro type(data);
data &data;
      set astc.&data;
      year=input(data_yr);
run;
%mend type;
 
%type (ppa_astc_cms1500_2013);
3 REPLIES 3
ballardw
Super User

Please provide exactly what happens that makes you think the macro is broken.

 

And paste the result of the Log into a code box opened using the forum {I} menu icon. It is important to paste into a code box as the message window reformats some of the error and warning messages and those often provide something that points to offending code errors.

 

The Input function wants an informat to apply when attempting to do what ever to the variable data_yr so you should have gotten an error.

 

Other possible problems may exist but we need to see the log for that.

   

Astounding
PROC Star

MACRO language isn't broken  Rather, your SAS language program is broken.  The INPUT function requires two arguments, and you have only supplied one.  It is best to follow the usual rule:  Get the program working without any macro language, and then turn the working code into a macro.

Kurt_Bremser
Super User

The only thing broken is your data step coding skills, as others have already mentioned 😉

 

Since no SAS/STAT procedures are involved, I moved this thread to Base SAS Programming, where it belongs.

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