BookmarkSubscribeRSS Feed
Jukon2
Fluorite | Level 6

Running the SAS code below generates this error:

 

ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,

a numeric constant, a datetime constant, a missing value, INPUT, PUT.

30 run;

 

SAS Code:

/*use the COMPBL function to read Location and convert each occurrence of two or more consecutive blanks into a single blank*/

data weather_japan_clean;

set pg2.weather_japan;

 

NewLocation=compbl(Location);

NewStation= ;

run;

 

This can be found as a response to Lesson 3 > Using Character Functions > Activity > 1.

Kindly review and assist provide correct response

12 REPLIES 12
Reeza
Super User

Please post the exact log. That will often include more information about exactly where the error is. It usually includes a line and column number in fact that lets you start to figure out where the error may be.

 


@Jukon2 wrote:

Running the SAS code below generates this error:

 

ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,

a numeric constant, a datetime constant, a missing value, INPUT, PUT.

30 run;

 

SAS Code:

/*use the COMPBL function to read Location and convert each occurrence of two or more consecutive blanks into a single blank*/

data weather_japan_clean;

set pg2.weather_japan;

 

NewLocation=compbl(Location);

NewStation= ;

run;

 

This can be found as a response to Lesson 3 > Using Character Functions > Activity > 1.

Kindly review and assist provide correct response


 

Jukon2
Fluorite | Level 6

I agree with you but this is how it was provided on the elearning platform as a response to one of the activity questions.

I've reached out to their customer service and hope to get a response?

Reeza
Super User
I would expect that to be the exercise, where you would then fill in the code for that line. If it's being shown as a solution, it would be wrong.
Jukon2
Fluorite | Level 6
Nope. this is not an exercise please. It is an answer to a question by the instructor. Still the instructor to look into this.
Jukon2
Fluorite | Level 6

Please find question and answer below.

Open p203a06.sas from the activities folder and perform the following tasks:

 

  • Complete the NewLocation assignment statement to use the COMPBL function to read Location and convert each occurrence of two or more consecutive blanks into a single blank.
data weather_japan_clean;
    set pg2.weather_japan;
    NewLocation=compbl(Location);
    NewStation= ;
run;

..

It will be nice to put ' ' in that space but I can't tell what the instructor was trying to depict or explain further. Thanks anyway.

Reeza
Super User
Which course is this? Not seeing it in the Programming 1 course, so I'm assuming it's a different one?
Jukon2
Fluorite | Level 6

Data manipulation Techniques

Lesson 3 > Using Character Functions > Activity > 1.

 

Kindly review and assist provide correct response

 

SAS Code:

/*use the COMPBL function to read Location and convert each occurrence of two or more consecutive blanks into a single blank*/

data weather_japan_clean;

set pg2.weather_japan;

 

NewLocation=compbl(Location);

NewStation= ;

run;

 

This can be found as a response to Lesson 3 > Using Character Functions > Activity > 1.

Kindly review and assist provide correct response

Reeza
Super User
You'll have to wait for SAS Learning to respond, most people won't have access to the course. You've already mentioned that you've contacted them, so that's the best course at the moment. FYI - the courses have been recently re-designed so it's definitely possible there's bugs in them still.
Jukon2
Fluorite | Level 6

Most probably!. Thanks for responding.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 12 replies
  • 1236 views
  • 2 likes
  • 3 in conversation