BookmarkSubscribeRSS Feed
Harish2
Calcite | Level 5

Hi team,

 

I have data in the below format and I need to convert into Graph. Graph should be 

Since they are values for jun17 both values should come in side by side by using vaertical bar.Please help me to resolve this problem?

This see the below code modify the below code and help me out.

 

proc sgplot data=GRAPH;
VBAR newdate / GROUP = Consumer_Review_Closed groupdisplay=cluster;
xaxis values=("&open_date_min"d to "&open_date_max"d by month) label=" ";
yaxis label=" ";
title "SURS Review";
run;

 

newdateConsumer_Review_ClosedProvider_Review_Opened
16-Jul..
16-Aug..
16-Sep..
16-Oct..
16-Nov..
16-Dec..
17-Jan..
17-Feb..
17-Mar..
17-Apr..
17-May.18
17-Jun74
6 REPLIES 6
ChrisNZ
Tourmaline | Level 20

You have to reorganise your data into database form so it is ready for plotting. This is not a spreadsheet.

data GRAPH;
  infile cards pad;
  input  NEWDATE date9. VALUE : 1. SERIES : $22.;
  format NEWDATE date9.	;
cards;
17Jun2017 4 Consumer_Review_Closed
17Jun2017 7 Provider_Review_Opened
run;
  
proc sgplot data=GRAPH;
  vbar NEWDATE / freq=VALUE group=SERIES groupdisplay=cluster;
run;
 

 Capture.PNG

 

 

Harish2
Calcite | Level 5

Hi Chris,

 

Thanks for the reply.I am getting the output for the graph in the normal program in the EG but If i transfer the same code to the stored process with EG I am getting below error.Please help me to resolev this error.

 

 

ERROR: Unable to load the Java Virtual Machine. Please see the installation instructions or system administrator.
ERROR: Unable to load the Java Virtual Machine. Please see the installation instructions or system administrator.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 24 observations read from the data set WORK.DS2.

 

Thanks,

Harish

 

ChrisNZ
Tourmaline | Level 20

Does the previous reply answer your question? Is this a new question?

Harish2
Calcite | Level 5

Hi Chris,

 

Thanks for the response.

 

Actually previous reply was already implemented and its working fine with the Program in the EG but I am not getting output of the garph in the stored process and I have attached the errors in the other mail.Please have a look and help me to resolve this issue.

 

Thanks,

Harish

Harish2
Calcite | Level 5

Hi Chris,

 

To be Precise on what i have required is, I need the putput of the graph in the attached. By using only GCHART and I am atatching the below code for your refernece.

 

PROC SQL;

CREATE TABLE Consumer_NEW AS 

SELECT DISTINCT A.*,COUNT(Consumer_Closed) AS Consumer_Review_Closed

FROM Consumer A

group by newdate;

quit;

 

 

PROC SQL;

CREATE TABLE OPENED1_NEW_repo AS 

SELECT DISTINCT A.*,COUNT(CASE_RK) AS Provider_Review_Opened

FROM OPENED1_NEW_1 A

group by newdate;

quit;

 

 

PROC SQL;

CREATE TABLE GRAPH AS 

SELECT distinct (A.newdate),A.Consumer_Review_Closed,B.Provider_Review_Opened FROM Consumer_NEW A

INNER JOIN OPENED1_NEW_repo B

ON A.newdate=B.newdate;

quit;

 

 data ds2;

    set GRAPH;                                                                                                                             

   n=_n_; 

rename newdate=year; 

run;                                                                                                                                     

                                                                                                                                        

data _null_;                                                                                                                             

   set ds2 end=eof;                                                                                                                     

   if eof then call symput('skip',left(n));  

 

run;                                                                                                                                    

                                                                                                                                        

data ds2;                                                                                                                                

   set ds2;                                                                                                                             

   resp=Provider_Review_Opened; mid='Provider_Review_Opened'; output;                                                                                                          

   resp=Consumer_Review_Closed; mid='Consumer_Review_Closed'; output;                                                                                                         

run;                                                                                                                                    

                                                                                                                                         

proc sort;                                                                                                                              

   by year mid;                                                                                                                          

run;

data ds2;

   set ds2;

   array change _NUMERIC_;

            do over change;

            if change=. then change=0;

            end;

   run;

 

Ineed to get the graph of this by using only GCHART.please reply at the earliest.

 

Thanks,

harish

ChrisNZ
Tourmaline | Level 20

1-You added the Java VM error as a second issue in this post.

Did you google the mesage you are getting? You'll find many matches.

If these don't help please open a new post with a meaningfule title such as: SGPLOT "ERROR: Unable to load the Java Virtual Machine."

 

2- Is the chart you now have what you want?

 

3- Do no post MS office files. Few people will risk opening these files. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 6 replies
  • 1297 views
  • 0 likes
  • 2 in conversation