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

First off, my apologies for the lame question perhaps lack of sleep, tiredness or whatever.

Ok question, from sas function documentation

 

charlist

specifies an optional character expression that initializes a list of characters. This list determines which characters are used as the delimiters that separate words. The following rules apply:

  • By default, all characters in charlist are used as delimiters.

  • If you specify the K modifier in the modifier argument, then all characters that are not in charlist are used as delimiters.

Tip: You can add more characters to charlist by using other modifiers.

 

 

where is the charlist list in sas documentation? This irks me

1 ACCEPTED SOLUTION
4 REPLIES 4
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

I have found a few in SAS help but never found a full list.

novinosrin
Tourmaline | Level 20

Thank you @PaigeMiller  That's the doc i needed. Hmm the answer i wanted was right there viz.

 

Using Default Delimiters in ASCII and EBCDIC Environments

If you use the SCAN function with only two arguments, then the default delimiters depend on whether your computer uses ASCII or EBCDIC characters.
  • If your computer uses ASCII characters, the default delimiters are as follows:
    blank ! $ % & ( ) * + , - . / ; < ^ |
    In ASCII environments that do not contain the ^ character, the SCAN function uses the ~ character instead.
  • If your computer uses EBCDIC characters, then the default delimiters are as follows:
    blank ! $ % & ( ) * + , - . / ; < ¬ | ¢
 
If you use the modifier argument without specifying any characters as delimiters, then the only delimiters that are used are delimiters that are defined by the modifier argument. In this case, the lists of default delimiters for ASCII and EBCDIC environments are not used. In other words, modifiers add to the list of delimiters that are explicitly specified by the charlist argument. Modifiers do not add to the list of default modifiers.
novinosrin
Tourmaline | Level 20

And why the problem arose was thanks to this :

 when i desired (1995)

1013 data _null_;
1014 k='Toy Story (1995)';
1015 k1=scan(k,-1);
1016 put k1=;
1017 run;

k1=1995

 

 

 

and it's pretty apparent, the explicit charlist specification was needed

 

data _null_;
k='Toy Story (1995)';
k1=scan(k,-1,' ');
put k1=;
run;

 

 

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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