BookmarkSubscribeRSS Feed
shyamtawde
Fluorite | Level 6

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;

5 REPLIES 5
ScottBass
Rhodochrosite | Level 12

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 your question as a self-contained data step in the form of "have" (source) and "want" (desired results).
I won't contribute to your post if I can't cut-and-paste your syntactically correct code into SAS.
andreas_lds
Jade | Level 19

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.

shyamtawde
Fluorite | Level 6
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;
Astounding
PROC Star

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.

ballardw
Super User

@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


Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

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
  • 5 replies
  • 743 views
  • 0 likes
  • 5 in conversation