The SAS Output Delivery System and reporting techniques

NewBee help

Reply
N/A
Posts: 0

NewBee help

hey i am a newbee in SAS...and i need a lot of help. could amyone please tell me how to modify permanent data sets in programs?
thnx
N/A
Posts: 0

Re: NewBee help

Posted in reply to deleted_user
Usually you use a datastep, which could look something like:


data MyLibrary.MyPermanentSASDataset; set MyLibrary.MyPermanentSASDataset;
* Place your modifications here, e.g.;
var2 = var1 * 2;
run;
N/A
Posts: 0

Re: NewBee help

Posted in reply to deleted_user
1.HOW do i read a tab separated text file using the DATA command?
2.how do i edit a variable's properties of a permanent data set?(meaning changing it from character to numeric or vice versa)
3. can i specify the format of the variables in the proc import command?
N/A
Posts: 0

Re: NewBee help

Posted in reply to deleted_user
1. You could use something like this:
data work.MyDSN;
infile "MyPathToMyRawDatafile\RawDataFile" dlm = '09'x;
input charvar1 $ charvar2 $ numvar1 ;
run;

2. To change the type of a variable you could create a new variable and put the old variable into the new one. If you want you can drop the old variable as well;

data MyDSN; set MyDSN;
length numvar_new 8 charvar_new $ 4;
numvar_new = put(charvar_old,1.0);
charvar_new = put(numvar_old,1.0);
* If the old variables are no longer wanted;
drop charvar_old numvar_old;
run;

3. The SAS Help Documentation does not mention such an option, thus the answer is: no. If you want to use formats you should add a datastep after the proc import in which you specify the formats for each variable OR you use a datastep to import (instead of proc import) and specify there which formats the variables should have.
Contributor
Posts: 35

Re: NewBee help

Posted in reply to deleted_user
the first put (that you are using to convert to a numeric) should be input.
Ask a Question
Discussion stats
  • 4 replies
  • 145 views
  • 0 likes
  • 2 in conversation