04-12-2017 10:09 AM
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.
04-12-2017 11:42 AM
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:
/* 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;
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.
04-12-2017 12:49 PM
04-12-2017 03:37 PM
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.