I'm a beginner,i have to import csv file and make some changes and send the output to CSV file.Could somebody send the code.
And also we have to apply these conditions,the order should be refferal,approval and ship.If approval comes first, we have to switch the values of approval and refferal(In line 7 of data approval came first,we have to switch the values based on
In EGuide, you can use file --> import to bring in the .csv file to a SAS dataset, then you can use the Query Builder to manipulate the data, and file--> export to send it back out again.
I would recommend "SAS for dummies" or "the Little SAS book for EGuide x.x" to get you going on the data transformations, as it is rather difficult to narrate the interactive process of data transformations.
You probably need to provide a sample of the desired output. I can't tell which fields you want to swap values for. Since you have duplicates of the milestone_type, you need to tell what you want to do with those too. This may not be something for query builder; it may need some other combination of procedures and/or data steps.
If you only have one of each, this could be done with a combination of transpose (split columns) and query builder.
proc sort data=have;
by DRC_CASE_ID Milestone_Date;
data ReferralSecond (keep=DRC_CASE_ID);
if first.DRC_CASE_ID then counter=0;
if counter=2 and upcase(MILESTONE_TYPE)='REFERRAL' then output;
merge have ReferralSecond (in=RS);
if first.DRC_CASE_ID and RS and upcase(MILESTONE_TYPE)='APPROVAL' then
if counter=2 and upcase(MILESTONE_TYPE)='REFERRAL' then MILESTONE_TYPE=propcase('APPROVAL');