10-04-2016 06:46 AM
Why it is an invalid SAS code? text should not be attached with quates. I mean, "200160930" is a string and 2,4 takes the string starting for the 2nd character (i.e. 2) and a length of 4 bytes. so it could be 20016. Please correct me
10-04-2016 06:56 AM
beg_date = substr("200160930",2,4)0129;
Here. What I assume you want is to concatenate the substr() result with the 0129, so maybe:
beg_date = substr("200160930",2,4) || "0129";
beg_date = cats(substr("200160930",2,4),"0129");
Note however that your resulting string will look like this:
As the 2 means, start at character 2, and then read 4 characters from there, per the manual:
10-04-2016 08:19 AM
Take a look at SAS University Edition, which is specifically made for learning purposes.
10-04-2016 06:31 AM
As per your other post some minutes back, the macro variable gets replaced with the text you specify, then that gets passed into the SAS compiler, which throws an error as @Reeza has mentioned.
beg_date = SUBSTR("200160930",2,4)0129;
I would suggest looking through the manual at each function you need explanation on. Then with the code you have replace the
With the text you give. Then check that it looks like valid SAS code. Macro only generates text, Base SAS is the language.