BookmarkSubscribeRSS Feed
adricano
Obsidian | Level 7

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?

6 REPLIES 6
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

adricano
Obsidian | Level 7
I usually import Excel files but sometimes is more easier to use proc fsedit to correct a sas file
ballardw
Super User

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
Obsidian | Level 7
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


Reeza
Super User

@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.

AllanBowe
Barite | Level 11

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

 

 

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 1548 views
  • 1 like
  • 5 in conversation