Data EG;
LENGTH SUBJID 3 VISIT $30 DOMAIN $30 Was_ECG_Performed $30 EG_STAT_NO $100 Overall_assessment $50 EG_DESC_ABNL $100;
infile "\\arlhosas\CDS\TLF Creations\HALAVEN\Tables\12-Lead ECG\EG.csv" delimiter = ',' missover dsd firstobs = 2;
input SUBJID VISIT$ DOMAIN$ Was_ECG_Performed$ EG_STAT_NO$ Overall_assessment$ EG_DESC_ABNL$;
Run;
/*title "FREQUENCY TABLE FOR 12 LEAD ECG";
Proc freq data = work.EG;
tables Was_ECG_Performed Overall_assessment/ nocum;
Label Was_ECG_Performed='Was ECG Performed?' Overall_assessment='Overall assessment';
Run;*/
Proc report data=eg;
Column Was_ECG_Performed Overall_assessment;
Define Was_ECG_Performed/Computed;
Define Overall_assessment/Computed;
Compute after;
Was_ECG_Performed = (YES/YES+NO)*100;
endcomp;
run;
What's your question?
We cannot run your code since we do not have the source file.
A log extract would be useful.
Put a little more effort into asking your question.
But, given the info you've provided, I'd say you need to reboot your SAS server.
Please post code using {i} or running-man icon and format the code before to increase readability.
If you can't post the data, maybe posting the log, using the already mentioned {i}-icon, could help us helping you.
Data EG;
LENGTH SUBJID 3 VISIT $30 DOMAIN $30 Was_ECG_Performed $30 EG_STAT_NO $100 Overall_assessment $50 EG_DESC_ABNL $100;
infile "EG.csv" delimiter = ',' missover dsd firstobs = 2;
input SUBJID VISIT$ DOMAIN$ Was_ECG_Performed$ EG_STAT_NO$ Overall_assessment$ EG_DESC_ABNL$;
Run;
Proc report data=EG;
Column Was_ECG_Performed Overall_assessment;
Define Was_ECG_Performed/Computed;
Define Overall_assessment/Computed;
Compute after;
Was_ECG_Performed = (YES/YES+NO)*100;
endcomp;
Run;
A couple of items are way off base here.
Your incoming data set contains a character variable named Was_ECG_Performed. Yet you are trying to compute a numeric variable using that name.
Your program refers to two variables named YES and NO. Where do they come from?
The posters here always appreciate when you have tried to solve the problem first, and showing what you tried. In this case, you might be better off trying to describe the result you are trying to obtain.
@shyamtawde wrote:
Data EG;
LENGTH SUBJID 3 VISIT $30 DOMAIN $30 Was_ECG_Performed $30 EG_STAT_NO $100 Overall_assessment $50 EG_DESC_ABNL $100;
infile "\\arlhosas\CDS\TLF Creations\HALAVEN\Tables\12-Lead ECG\EG.csv" delimiter = ',' missover dsd firstobs = 2;
input SUBJID VISIT$ DOMAIN$ Was_ECG_Performed$ EG_STAT_NO$ Overall_assessment$ EG_DESC_ABNL$;
Run;
/*title "FREQUENCY TABLE FOR 12 LEAD ECG";
Proc freq data = work.EG;
tables Was_ECG_Performed Overall_assessment/ nocum;
Label Was_ECG_Performed='Was ECG Performed?' Overall_assessment='Overall assessment';
Run;*/Proc report data=eg;
Column Was_ECG_Performed Overall_assessment;
Define Was_ECG_Performed/Computed;
Define Overall_assessment/Computed;
Compute after;
Was_ECG_Performed = (YES/YES+NO)*100;
endcomp;
run;
What ever is going on you likely have a logic error in the line I highlighted above.
Yes/yes is going to return 1 as long as Yes in not zero and defined. I think you intended to use:
yes/(yes+no) * 100
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!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.