libname orion "/courses/d0f434e5ba27fe300/mac1" access=readonly; %let DSN = work.test; %let FIRST = %substr(&DSN., 6,1); %put The value of ckbegin = %verify(&DSN., &FIRST.);
In my homework, I am supposed to create a macro variable named DSN which equals work.test, extract the first letter of the data set name work.test and call it FIRST, and use an autocall macro to verify the value of first against a list of valid values. The output to the log should say ckbegin = 0 but my output says ckbegin = 1. I have attached my code and log.
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
70
71 libname orion "/courses/d0f434e5ba27fe300/mac1" access=readonly;
NOTE: Libref ORION was successfully assigned as follows:
Engine: V9
Physical Name: /courses/d0f434e5ba27fe300/mac1
72 %let DSN = work.test;
73 %let FIRST = %substr(&DSN., 6,1);
74 %put The value of ckbegin = %verify(&DSN., &FIRST.);
The value of ckbegin = 1
75
76
77
78 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
90
Where is the list of valid values?
You asked it to find the first character in work.test that is not in t and it is returning 1 since the first character, w, is not in the one character string t.
What kind of sick teacher assigned you homework using the very obscure macro implementation of the obscure VERIFY() function?
Syntax
Required Arguments
source
specifies a character constant, variable, or expression.
excerpt
specifies a character constant, variable, or expression. If you specify more than one excerpt, separate the excerpts with a comma.
Details
The VERIFY function returns the position of the first character in source that is not present in any excerpt. If VERIFY finds every character in source in at least one excerpt, VERIFY returns a 0.
Where is the list of valid values?
You asked it to find the first character in work.test that is not in t and it is returning 1 since the first character, w, is not in the one character string t.
What kind of sick teacher assigned you homework using the very obscure macro implementation of the obscure VERIFY() function?
Syntax
Required Arguments
source
specifies a character constant, variable, or expression.
excerpt
specifies a character constant, variable, or expression. If you specify more than one excerpt, separate the excerpts with a comma.
Details
The VERIFY function returns the position of the first character in source that is not present in any excerpt. If VERIFY finds every character in source in at least one excerpt, VERIFY returns a 0.
Thank you. I understand now!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.