BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

2. El contenido parcial de la tabla SASHELP.CARS es el siguiente:

Make Type MSRP
----------------------------
Acura SUV $36,945
Acura Sedan $23,820
Acura Sedan $26,990
Audi Sedan $25,940
Audi Sedan $35,940
Audi Sedan $31,840
Audi Sedan $33,430
BMW SUV $37,000
BMW SUV $52,195
BMW Sedan $28,495
BMW Sedan $30,795


Se ejecuta la siguiente defición y llamado de macro:

%Macro Crear_Cars( Parm_Make );

Data &Parm_Make;
Set SASHelp.Cars;
Select( UpCase(Make) );
When( "&Parm_Make" ) Output &Parm_Make;
Otherwise;
End;
Run;

%Mend Crear_Cars;

%Crear_Cars(Audi)


Y el LOG indica que la tabla final WORK.AUDI "NO TIENE REGISTROS"

7 %Macro Crear_Cars( Parm_Make );
8
9 Data &Parm_Make;
10 Set SASHelp.Cars;
11 Select( UpCase(Make) );
12 When( "&Parm_Make" ) Output &Parm_Make;
13 Otherwise;
14 End;
15 Run;
16
17 %Mend Crear_Cars;
18
19 %Crear_Cars(Audi)

NOTE: There were 428 observations read from the data set SASHELP.CARS.
NOTE: The data set WORK.AUDI has 0 observations and 15 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds


Se detecta que el error se corrige colocando una SENTENCIA MACRO que está ausente.

Envíe la definción de la macro corregida.

1 ACCEPTED SOLUTION

Accepted Solutions
Berenice25
SAS Employee

Hola a todos 

Espero que se ecuentren muy bien 

 

Confirmando la respuesta correcta de este desafío es la siguiente:

 

FALTA COLOCAR LA SENTENCIAS %UPCASE()

 

%Macro Crear_Cars( Parm_Make );

	    Data &Parm_Make;
		Set SASHelp.Cars;
		Select( UpCase(Make) );
		    When( "%UPCASE( &Parm_Make )" ) Output &Parm_Make;
		    Otherwise;
		End;
	    Run;

	%Mend Crear_Cars;

 

 

Vamos al resultado de nuestro sorteo. ¿Listos?🏆

 

Los ganadores del Kit Customer Success son:

 

Captura web_1-3-2022_12511_echaloasuerte.com.jpeg

 

Muchas felicidades chicos 🎉

Para esta dinámica vamos a regalar otro obsequio, participantes estén atentos a sus correos electrónicos le llegará al ganador un email sorpresa.

 

Suerte 🍀

 

Gracias por confiar en nosotros 

 

Saludos!!

 

 

View solution in original post

24 REPLIES 24
jcvargasr
Fluorite | Level 6
Colocando %UpCase
Ironsss
Calcite | Level 5

%Macro Crear_Cars( Parm_Make );

Data &Parm_Make;

Set SASHelp.Cars;

Select( %UpCase(Make) );

When( "&Parm_Make" ) Output &Parm_Make; Otherwise; End;

Run; %Mend Crear_Cars; %Crear_Cars(Audi)

rubenvaldez
Calcite | Level 5
%Macro Crear_Cars( Parm_Make );

Data &Parm_Make;
Set SASHelp.Cars;
Select( %UpCase(Make) );
When( "&Parm_Make" ) Output &Parm_Make;
Otherwise;
End;
Run;

%Mend Crear_Cars;
pcovian
Fluorite | Level 6
agergar % en la fucnion upcase
Lizeth
Fluorite | Level 6
%Macro Crear_Cars( Parm_Make );

Data &Parm_Make;
Set SASHelp.Cars;
Select( %UpCase(Make) );
When( "&Parm_Make" ) Output &Parm_Make;
Otherwise;
End;
Run;

%Mend Crear_Cars;
TomNunez
Fluorite | Level 6

%Macro Crear_Cars( Parm_Make);

Data &Parm_Make;
Set SASHelp.Cars;
Select( %UpCase(Make));
When("&Parm_Make") Output &Parm_Make;
Otherwise;
End;
Run;

 

%Mend Crear_Cars;

Karen88
Calcite | Level 5
%Macro Crear_Cars( Parm_Make );

Data &Parm_Make;
Set SASHelp.Cars;
Select( %UpCase(Make) );
When( "&Parm_Make" ) Output &Parm_Make;
Otherwise;
End;
Run;
vmorales
Fluorite | Level 6
%UpCase
HMORALESA
Calcite | Level 5
%Macro Crear_Cars( Parm_Make );

Data &Parm_Make;
Set SASHelp.Cars;
Select( UpCase(Make) );
When( "%UPCASE( &Parm_Make )" ) Output &Parm_Make;
Otherwise;
End;
Run;

%Mend Crear_Cars;

%Crear_Cars(Audi)
Vairoleto
Fluorite | Level 6

cambiar

Select( UpCase(Make) );

por

Select( %UpCase(Make) );
wiliambejarapi
Calcite | Level 5
%Macro Crear_Cars( Parm_Make );

Data &Parm_Make;
Set SASHelp.Cars;
Select( %UpCase(Make) );
When( "&Parm_Make" ) Output &Parm_Make;
Otherwise;
End;
Run;

%Mend Crear_Cars;

%Crear_Cars(Audi)
chapingo
Fluorite | Level 6

poner %UpCase

SaulGT
SAS Employee

Colocando el %upcase en el when, por ejemplo when ("%UPCASE(&Parm_Make)" output &Parm_Make;

SanGuerrero
Calcite | Level 5

%Macro Crear_Cars( Parm_Make );

Data &Parm_Make;
Set SASHelp.Cars;
Select( UpCase(Make) );
When( "%UPCASE(&Parm_Make)" ) Output &Parm_Make;
Otherwise;
End;
Run;

%Mend Crear_Cars;

%Crear_Cars(Audi)

SAS Innovate 2025: Register 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!

Discussion stats