Hi ALL,
Am trying to learn Macros and got stuck in the very first code because its not giving any output/result..
%MACRO PRNT(ABC);
PROC PRINT DATA=&ABC;
RUN;
%MEND PRNT;
%PRNT(SASHELP.CLASS);
do i need to change the result/output setting from preferences?
how do i rectify this?
thanks,
Eram.
log doesnt say anything, just the typed macro is coming in log window with out any error, warning or note
SAS 9.3, but am working on VMware.
Tried couple of times to run the macro using different conbinations but still no result but the log is showing only the Macro typed by me without any error or warning..
also the proc print step is coming in black color rather than blue- inside the the macro, is that ok?
2580 %MACRO PRNT_DT (ABC, V1, V2);
2581 PROC PRINT DATA=&ABC;
2582 VAR &V1 &V2;
2583 %MEND;
2584 %MACRO PRNT_DT = (CARS, MAKE, ORIGIN);
ERROR: Expected semicolon not found. The macro will not be compiled.
ERROR: A dummy macro will be compiled.
2585 %MACRO PRNT_DT (ABC, V1, V2);
2586 PROC PRINT DATA=&ABC;
2587 VAR &V1 &V2;
2588 RUN;
2589 %MEND;
2591 %PRNT_DT = (CARS, MAKE, ORIGIN);
2592 %MACRO PRNT_DT (ABC, V1, V2);
2593 PROC PRINT DATA=&ABC;
2594 VAR &V1 &V2;
2595 RUN;
2596 %MEND PRNT_DT;
2602 %PRNT;
2603 %MACRO PRNT(ABC);
2604 PROC PRINT DATA=&ABC;
2605 RUN;
2606 %MEND PRNT;
2607 %PRNT(CARS);
2608 %PRNT(CARS);
2609 %PRNT(SASHELP.CLASS);
2610 %PRNT(SASHELP.CLASS);
2611 %MACRO PRNT(ABC);
2612 PROC PRINT DATA=&ABC;
2613 RUN;
2614 %MEND PRNT;
2616 %PRNT(SASHELP.CLASS);
Tried closing the session again and relogged in, Macro working fine now..
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.