Data visualization with SAS programming

Newbie here! Question about a proposal using SAS! :)

Reply
Contributor
Posts: 27

Newbie here! Question about a proposal using SAS! :)

Hello,

 

I have not ever used SAS programming (my programming experience includes ladder logic and some BASIC), however, my girlfriend is taking some Biostatistics courses, and uses the program daily. I got the idea of proposing using a graph output from the SAS program, as it would completely be a huge surprise to her. The problem is... I have absolutely no idea of how to go about writing a program that would display that, much less if it's even possible with this program? I'm really hoping that it would be possible, as this would be something I know she would find incredible that I found a way to do it! 

 

So, short version of my question - is it possible to have the SAS program display that message somehow? If yes, where would be a good place for me to go to start learning how to make it happen?

 

Thank you for your time!

 

-Brandon

Super User
Super User
Posts: 8,181

Re: Newbie here! Question about a proposal using SAS! :)

Posted in reply to grandpastyle13

Errm, you get the prize for weirdest question on a programming forum...ever.  Yes you can display messages in numerous ways depending on what software from SAS you use, Enterprise Guide can have promts/messages, base sas has the %window or window commands:

http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000206734.htm

For example.  You could play some music:

https://www.pharmasug.org/proceedings/2016/TT/PharmaSUG-2016-TT12.pdf

 

Maybe even plot out a graph so it looks like a hand and ring in a box

https://blogs.sas.com/content/graphicallyspeaking/

 

However they all take a fair bit of knowledge of the software.  Hope that helps.

Contributor
Posts: 27

Re: Newbie here! Question about a proposal using SAS! :)

Hahah! I'm okay with that. I know it's a weird thing to ask and want to do. But that's what's going to make it special. 

 

Thanks for the information, I appreciate it. Smiley Happy

Super User
Posts: 8,066

Re: Newbie here! Question about a proposal using SAS! :)

Posted in reply to grandpastyle13

If you haven't already done so, search in this community for subjects including "Fun with SAS ODS Graphics"; you might get some hints. If not sufficient, try to contact the author.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 27

Re: Newbie here! Question about a proposal using SAS! :)

Posted in reply to KurtBremser

Excellent! Thank you for the information, I appreciate it. Smiley Happy

Super User
Posts: 20,236

Re: Newbie here! Question about a proposal using SAS! :)

Posted in reply to grandpastyle13

You can pretty much draw anything in SAS graphics and/or make it animated...so, I think you first should design what you want to do and then ask specific questions. Start by looking at GTL and/or SGPLOT. 

 

You can get the free version of SAS by searching SAS UE and that will support those types of features....let us know how it goes and if she says yes Smiley Happy

SAS Super FREQ
Posts: 377

Re: Newbie here! Question about a proposal using SAS! :)

Following up on @Reeza and others, here is an example of drawing and animating a shape.   https://blogs.sas.com/content/graphicallyspeaking/2017/10/19/fun-ods-graphics-drawing-rotating-impos...


I found the geometry harder than the programming.  YMMV.

 

Super User
Posts: 20,236

Re: Newbie here! Question about a proposal using SAS! :)

Posted in reply to WarrenKuhfeld

Ok...here's two starting pointers that you can try. You can style the text and make it slower or have all the words appear once and can probably add images, ie ring/flowers if desired to the back ground.....like I said, you need to design it. 

 

Here's just the words appearing as a gif. I would suggest saying you have a friend programming in SAS who needs some help with a program. And you can pre-compile it and run it as a macro otherwise as soon as she see's the code the game is up...assuming it's a surprise.

 

data proposal;
input order words $ x y;
cards;
1 Will 100 100
2 You  100 100
3 Marry 100 100
4 Me? 100 100
;;;;



options papersize=('5 in', '3 in') printerpath=gif animation=start 
        animduration=1 animloop=no noanimoverlay nonumber nodate;
ods printer file='C:\_localdata\temp\demo1.gif';
 
ods graphics / width=5in height=3in imagefmt=GIF;

/* Generate the graphs by year and quarter */
proc sgplot data=proposal;
by order;
text x=x y=y text=words;
xaxis values=(0 to 200 by 50) display=none;
yaxis values=(0 to 200 by 50) display=none;
run;


options printerpath=gif animation=stop;
ods printer close;

Option 2:

 


data proposal2;
input order words $ x y;
cards;
1 Will 100 200
2 You  100 150
3 Marry 100 50
4 Me? 100 0
;;;;



options papersize=('5 in', '3 in') printerpath=gif animation=start 
        animduration=1 animloop=no noanimoverlay nonumber nodate;
ods printer file='C:\_localdata\temp\demo2.gif';
 
ods graphics / width=5in height=3in imagefmt=GIF;

/* Generate the graphs by year and quarter */
proc sgplot data=proposal2;
by order;
text x=x y=y text=words;
xaxis values=(0 to 200 by 50) display=none;
yaxis values=(0 to 200 by 50) display=none;
run;


options printerpath=gif animation=stop;
ods printer close;

 

Contributor
Posts: 27

Re: Newbie here! Question about a proposal using SAS! :)

You guys are totally awesome! This is a great starting point. I should be able to figure things out from all of this info. I've got about a month and a half to get it all ready, so it should be fine. And yes, of course it's going to be a surprise. I will keep you posted on her answer, although I'm already sure it's a yes. Thanks so much for the help! Smiley Happy You made my day!
Community Manager
Posts: 601

Re: Newbie here! Question about a proposal using SAS! :)

Posted in reply to grandpastyle13

This thread totally makes my day! If you video her reaction and she says yes (of COURSE she'll say yes!), post it here so we can celebrate with you.

-
Bev Brown
Visit me on LinkedIn.
Twitter too: @BevBrown
Thank you for using SAS.jpg
Highlighted
Trusted Advisor
Posts: 1,330

Re: Newbie here! Question about a proposal using SAS! :)

Posted in reply to BeverlyBrown

Hear Hear! I’m keen to hear the outcome of this beautiful SASsy love story! 

 

You’re a catch Brandon! Robot Happy

Community Manager
Posts: 3,023

Re: Newbie here! Question about a proposal using SAS! :)

[ Edited ]
Posted in reply to grandpastyle13

Just have to say -- I love this discussion!

 

You might also augment with programs from here, furnished by our resident statistician (and love doctor) @Rick_SAS.

 

Binary heart in SAS

binaryheart.png

 

A parametric view of love (adapt for your own message - note that this particular one requires SAS/IML Studio -- probably not an option for you.  But similar programs are out there.)

heart.png

 

Lo, how a polar rose e'er blooming

polarrose2.png

Contributor
Posts: 27

Re: Newbie here! Question about a proposal using SAS! :)

Hey Reeza,

 

So I ran both of the programs that you had given as a sample to see what they would look like. Neither of them will actually display as a .gif within the SAS program window. It shows each of the 4 cards individually, from top to bottom, instead of as a .gif. I also get the following error code:

 

ERROR: Insufficient authorization to access /opt/sasinside/SASConfig/Lev1/SASApp/C:\_localdata\temp\demo2.gif.
 
Do you have any idea of what would be causing this? I looked it up myself within the forums, and found something about how the shared folder I created when setting up the SAS utility needs to be where the program directory is. I tried changing the directory within the program text to the folder I used to setup the SAS utility, to no avail. It will still display an "Insufficient authorization to access" error.
 
So, I'm a bit stuck now. 
 
PROC Star
Posts: 854

Re: Newbie here! Question about a proposal using SAS! :)

Posted in reply to grandpastyle13

This is by far the most exciting thread I've ever seen on the communities Smiley Happy Smiley Happy

 

Go @grandpastyle13!

Contributor
Posts: 27

Re: Newbie here! Question about a proposal using SAS! :)

Posted in reply to grandpastyle13

I am awe-struck by all the helpful information and support this has received in just a few hours! What a great community! Smiley Happy

 

I am hoping to have some time to get started on this tonight, so I'll see how my first time goes. Haha.

 

Thank you everyone again, very kind of all of you! Smiley Happy

Ask a Question
Discussion stats