BookmarkSubscribeRSS Feed
Jianan_luna
Obsidian | Level 7

When I was doing level 1 practice(m104p01) under defining and calling a macro section/lesson 4: working with macro programs/SAS Mcaro Langua1: Essentials. I run the original code, but it always generated an error. Can you please help me to figure it out? Thanks so much! Here are the code and error message.

Jianan_luna_0-1598063881866.png

 

%let type=Gold;
title "&type Customers"; 
proc sql number;
select Name, Age_Group, Type 
    from mc1.customers 
    where Type contains "&type"; 
quit; 
title;
2 REPLIES 2
ballardw
Super User

Your issue is something actually in the data set.

One thing you might check is the file encoding, language character set used, by checking the details tab of the data set properties in the SAS file explorer or running Proc contents on the data set.

See if the file encoding matches your system setting.

 

Then run this code:

proc options group=(languagecontrol);
run;

And compare the result in the log for the options Encoding and the DBCS related options.

 

That type of error can indicate that you have some sort of double-byte character set in the data when the options are not set to handle them.

 

I would suspect yet another issue with running the proper setup for the training materials.

Cynthia_sas
Diamond | Level 26

Hi:

  When I make the data for class, using the instructions for my method of using SAS (SAS OnDemand for Academics) and then run your code without changes (just adding my own LIBNAME statement), then the code runs for me without errors:

Cynthia_sas_0-1598118695444.png

 My suggestion is that you go back and rerun the data creation program for the class data setup and then try again.

Cynthia

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

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