is it posible to work with proc fsedit under sas for university. If not, how do i get to modify my data set on line?
Even if its possible to use fsedit (and not sure as I don't use it), you will find that typing things into Excel and then importing the file is far easier to get data in - obviously remember Excel is a bad medium for data, however its big selling is that its easy as a data entry system.
I would suggest learning to use a more formal approach. Specific details might vary depending on the type of edit needed.
I would start by looking at data step code, possibly with an UPDATE or if the data correction is more rule based then IF/Then or appropriate selection and assignment statements.
Rationale: If Ihave the base data and a program to change it I can 1) undo the change if needed; 2) document all of the changes made; and 3) think about the data change while writing the code.
For some rough examples, I have worked with a lot of survey data where the questionnaire involved skip patterns (should have a response to this question only if the answer to another was a specific response or range of responses). If I "correct" something that now requires the follow up responses I might end up with a lot of enter, run check code and enter additional fixes, or if I correct something so that previously unanswered questions require a response there is other work.
In a data step i can so something like:
Data recoded;
set raw;
/* this respondents response to open end indicates that q1 should have been coded 4,
follow up questions were not answered but are set to no response*/
if respondent = '123' then do;
q1=4;
q1a=99;
q1b=99;
end;
run;
One advantage to this approach is if I need to make the same series of edits I can change the If statement to
if respondent in ('123', '456', '459', '645') then do;
Or image a case where a data collection system had a programming error and all the values to field that were recorded as 7 should actually be 77?
If q27=7 then q27=77;
in a datastep is much easier that opening a data set, finding the values and retyping them.
A single data step could have hundreds or thousands of edits that are reproducable as needed.
@adricano wrote:
I usually use if statement to correct some data, but in some occasions it is very useful, to be able to edit the file.
I will continue to work with the if sentence or export the data set to Excel.
Thanks a lot
It's useful to edit it manually but it's not a best practice by far. These days everything needs to be reproducible, especially if it's scientific research or a work product. In that respect, coding will include all the changes even if your IF/THEN statements are more tedious in the beginning but will save you headaches down the road.
FYI - In a recent interview process that I had, one candidate distinguished themselves by being the only candidate to correctly read in all the data AND documenting the data fixes. It seems small, but this really matters in the long run.
We built a tool very similar to FSEDIT but with a lot more control and automated validation of the inputs.
It's free for 5 users and works on Viya, SAS EBI, and Base SAS.
You can download / install it from here: https://4gl.uk/dcdeploy
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!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.