1. How do I prevent the 'character values have been converted to numeric values at the place by: (Line):(Column) from appearing the log message.
You read the variable Urban in the first data step as numeric.
You compare
Urban = '1'
The '1' is a character value. To actually compare to the defined numeric variable Urban SAS tries to help by converting to numeric to see if the comparison can be done.
Fix: don't compare to a character value
Urban = 1
or read the variable as character.
2. How do I make the variable name: AgeOld values appear as words like 'Old' and 'Young' and not as '1' and '0' (original values in data set) in the output for the MEANS procedure, when I use the PROC MEANS step.
Value appearance or display is the role of the variable FORMAT.
You make a custom format to associate the value with the desired text. Note that you are again displaying a numeric variable AgeOld which has values of 1 or 0 with quotes marks which would be character variable. Here a one way to create such a format and then associate the format in use in a procedure.
Proc Format;
value AgeOld
1='Old'
0='Young'
;
proc means;
var ageold ;
format ageold ageold. ;
run;
Caution: This is a temporary format an will only exist for the duration of the current session. You will need to rerun the Proc Format code to make it available in other sessions.
3. How to permanently save a combined data set to a flash drive how do I that? Is it like the basic way or there is a code I have to use?
With SAS code you could assign a LIBNAME to the drive and use SAS tools to copy the set.
When the flashdrive is active in the computer it should have a drive letter assigned. Suppose after you insert it Windows explorer shows it as Drive F.
In your code include:
libname flash "F:\";
proc copy in=work /* of the name of the library where the "combined" set resides*/
out=flash;
select combined; /* of the name of the data set you want to copy from the
work library*/
run;
If your flash drives have folders add them like "F:\folder1\subfolder";
Or without involving SAS at all go to the location of the library using Windows Explorer or other file management program, copy the "combined.sas7bdat" using the Windows Explorer copy and paste or drag and drop.
Note that your WORK library on a Windows system is likely to look something like this:
C:\Users\XXXXX\AppData\Local\Temp\SAS Temporary Files\_TD9028_DESKTOP-C36D7SF_
but that last folder name changes every session