yelkenli Tracker
https://communities.sas.com/kntur85557/tracker
yelkenli TrackerTue, 16 Apr 2024 10:00:50 GMT2024-04-16T10:00:50ZHow to show both group values in the legend for a two series sgplot line graph
https://communities.sas.com/t5/Graphics-Programming/How-to-show-both-group-values-in-the-legend-for-a-two-series/m-p/826186#M23036
<P>I have the below code and some example data. The resulting sgplot line graph shows only the variable value of the first series statement (in this case the _best), in the legend. I would like the legend to show both best and worst group variable values. Any suggestions?</P><P> </P><PRE><CODE class="">proc sgplot data=best_worst_stats ;
by cat_name;
title "Trend of median over week for #byval1";
series x=fiscal_wk y=median_best / group=prod_best;
series x=fiscal_wk y=median_worst / group=prod_worst;
run;</CODE></PRE><P>some example data</P><TABLE><TBODY><TR><TD>fiscal_wk</TD><TD>cat_name</TD><TD>wpfw</TD><TD>prod_best</TD><TD>median_best</TD><TD>prod_worst</TD><TD>median_worst</TD></TR><TR><TD>202126</TD><TD>soap</TD><TD>202126</TD><TD>159023</TD><TD>39.82</TD><TD>196907</TD><TD>32.72</TD></TR><TR><TD>202127</TD><TD>soap</TD><TD>202127</TD><TD>159023</TD><TD>19.25</TD><TD>196907</TD><TD>21.02</TD></TR><TR><TD>202128</TD><TD>soap</TD><TD>202128</TD><TD>159023</TD><TD>25.35</TD><TD>196907</TD><TD>127.36</TD></TR><TR><TD>202129</TD><TD>soap</TD><TD>202129</TD><TD>159023</TD><TD>27.78</TD><TD>196907</TD><TD>80.6</TD></TR><TR><TD>202130</TD><TD>soap</TD><TD>202130</TD><TD>159023</TD><TD>23.37</TD><TD>196907</TD><TD>47.71</TD></TR><TR><TD>202131</TD><TD>soap</TD><TD>202131</TD><TD>159023</TD><TD>14.87</TD><TD>196907</TD><TD>82.72</TD></TR><TR><TD>202132</TD><TD>soap</TD><TD>202132</TD><TD>159023</TD><TD>29.08</TD><TD>196907</TD><TD>144.06</TD></TR><TR><TD>202133</TD><TD>soap</TD><TD>202133</TD><TD>159023</TD><TD>22.7</TD><TD>196907</TD><TD>102.94</TD></TR><TR><TD>202126</TD><TD>shampoo</TD><TD>202126</TD><TD>458372</TD><TD>21.9</TD><TD>912064</TD><TD>23.19</TD></TR><TR><TD>202127</TD><TD>shampoo</TD><TD>202127</TD><TD>458372</TD><TD>21.88</TD><TD>912064</TD><TD>34.98</TD></TR><TR><TD>202128</TD><TD>shampoo</TD><TD>202128</TD><TD>458372</TD><TD>26.31</TD><TD>912064</TD><TD>50.86</TD></TR><TR><TD>202129</TD><TD>shampoo</TD><TD>202129</TD><TD>458372</TD><TD>24.2</TD><TD>912064</TD><TD>28.21</TD></TR><TR><TD>202130</TD><TD>shampoo</TD><TD>202130</TD><TD>458372</TD><TD>24.78</TD><TD>912064</TD><TD>27.66</TD></TR><TR><TD>202131</TD><TD>shampoo</TD><TD>202131</TD><TD>458372</TD><TD>24.87</TD><TD>912064</TD><TD>38.59</TD></TR><TR><TD>202132</TD><TD>shampoo</TD><TD>202132</TD><TD>458372</TD><TD>36</TD><TD>912064</TD><TD>82.19</TD></TR><TR><TD>202133</TD><TD>shampoo</TD><TD>202133</TD><TD>458372</TD><TD>18.2</TD><TD>912064</TD><TD>35.8</TD></TR></TBODY></TABLE><P> </P><P>get</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yelkenli_0-1659112161250.png" style="width: 400px;"><img src="https://communities.sas.com/t5/image/serverpage/image-id/73891i292319C996C4A158/image-size/medium?v=v2&px=400" role="button" title="yelkenli_0-1659112161250.png" alt="yelkenli_0-1659112161250.png" /></span></P><P> </P><P> </P><P>want</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yelkenli_1-1659112224028.png" style="width: 400px;"><img src="https://communities.sas.com/t5/image/serverpage/image-id/73892i735467E4D2193B76/image-size/medium?v=v2&px=400" role="button" title="yelkenli_1-1659112224028.png" alt="yelkenli_1-1659112224028.png" /></span></P><P> </P>Fri, 29 Jul 2022 16:30:39 GMThttps://communities.sas.com/t5/Graphics-Programming/How-to-show-both-group-values-in-the-legend-for-a-two-series/m-p/826186#M23036yelkenli2022-07-29T16:30:39ZHow do you print to sheets by group with some variables in the titles
https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-you-print-to-sheets-by-group-with-some-variables-in-the/m-p/825462#M25875
<P>I have the below code and output, but would like to remove some of the variables in the printed tables and put in a series of titles at the top of each worksheet. </P><P>Can this be done in one proc print step, or do I need some looping program?</P><P> </P><P> </P><PRE><CODE class="">ods tagsets.excelxp file="user/high_runs.xml"
style=styles.plateau
options(sheet_interval='BYGROUP' sheet_name='#byval1');
proc print data=high_runs;
by high_group;
run;
ods tagsets.excelxp close;</CODE></PRE><P>the output (the high_runs dataset would be this table, but with the high_group variable)</P><P> </P><BLOCKQUOTE><TABLE><TBODY><TR><TD>prod_name</TD><TD>prod_number</TD><TD>prod_type_name</TD><TD>prod_cost</TD><TD>local_dttm</TD><TD>qty_a</TD><TD>qty_b</TD></TR><TR><TD>prod1</TD><TD>1001</TD><TD>small</TD><TD>23</TD><TD>02MAY2021:21:10:00.000000</TD><TD>165</TD><TD>373</TD></TR><TR><TD>prod1</TD><TD>1001</TD><TD>small</TD><TD>23</TD><TD>02MAY2021:21:20:00.000000</TD><TD>381</TD><TD>555</TD></TR><TR><TD>prod2</TD><TD>1002</TD><TD>med</TD><TD>24</TD><TD>02MAY2021:21:30:00.000000</TD><TD>414</TD><TD>658</TD></TR><TR><TD>prod2</TD><TD>1002</TD><TD>med</TD><TD>24</TD><TD>02MAY2021:21:40:00.000000</TD><TD>680</TD><TD>1106</TD></TR><TR><TD>prod2</TD><TD>1002</TD><TD>med</TD><TD>24</TD><TD>02MAY2021:21:50:00.000000</TD><TD>635</TD><TD>1052</TD></TR><TR><TD>prod2</TD><TD>1002</TD><TD>med</TD><TD>24</TD><TD>02MAY2021:22:00:00.000000</TD><TD>517</TD><TD>812</TD></TR><TR><TD>prod3</TD><TD>1003</TD><TD>large</TD><TD>25</TD><TD>02MAY2021:22:10:00.000000</TD><TD>641</TD><TD>1043</TD></TR><TR><TD>prod3</TD><TD>1003</TD><TD>large</TD><TD>25</TD><TD>02MAY2021:22:20:00.000000</TD><TD>681</TD><TD>1642</TD></TR><TR><TD>prod3</TD><TD>1003</TD><TD>large</TD><TD>25</TD><TD>02MAY2021:22:30:00.000000</TD><TD>878</TD><TD>1689</TD></TR><TR><TD>prod3</TD><TD>1003</TD><TD>large</TD><TD>25</TD><TD>02MAY2021:22:40:00.000000</TD><TD>1130</TD><TD>1547</TD></TR><TR><TD>prod3</TD><TD>1003</TD><TD>large</TD><TD>25</TD><TD>02MAY2021:22:50:00.000000</TD><TD>1294</TD><TD>1477</TD></TR></TBODY></TABLE></BLOCKQUOTE><P>Wanted: </P><BLOCKQUOTE><TABLE><TBODY><TR><TD>prod_name: prod1</TD><TD> </TD><TD> </TD></TR><TR><TD>prod_number: 1001</TD><TD> </TD><TD> </TD></TR><TR><TD>prod_type_name: small</TD><TD> </TD><TD> </TD></TR><TR><TD>prod_cost: 23</TD><TD> </TD><TD> </TD></TR><TR><TD> </TD><TD> </TD><TD> </TD></TR><TR><TD>local_dttm</TD><TD>qty_a</TD><TD>qty_b</TD></TR><TR><TD>02MAY2021:21:00:00.000000</TD><TD>69</TD><TD>173</TD></TR><TR><TD>02MAY2021:21:10:00.000000</TD><TD>165</TD><TD>373</TD></TR><TR><TD> </TD><TD> </TD><TD> </TD></TR><TR><TD>next worksheet</TD><TD> </TD><TD> </TD></TR><TR><TD>prod_name: prod2</TD><TD> </TD><TD> </TD></TR><TR><TD>prod_number: 1002</TD><TD> </TD><TD> </TD></TR><TR><TD>prod_type_name: med</TD><TD> </TD><TD> </TD></TR><TR><TD>prod_cost: 224</TD><TD> </TD><TD> </TD></TR><TR><TD> </TD><TD> </TD><TD> </TD></TR><TR><TD>local_dttm</TD><TD>qty_a</TD><TD>qty_b</TD></TR><TR><TD>02MAY2021:21:20:00.000000</TD><TD>381</TD><TD>555</TD></TR><TR><TD>02MAY2021:21:30:00.000000</TD><TD>414</TD><TD>658</TD></TR><TR><TD>02MAY2021:21:40:00.000000</TD><TD>680</TD><TD>1106</TD></TR><TR><TD>02MAY2021:21:50:00.000000</TD><TD>635</TD><TD>1052</TD></TR></TBODY></TABLE></BLOCKQUOTE><P> </P><P> </P>Tue, 26 Jul 2022 15:42:40 GMThttps://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-you-print-to-sheets-by-group-with-some-variables-in-the/m-p/825462#M25875yelkenli2022-07-26T15:42:40ZRe: Convert char datetime to sas date format with EU format
https://communities.sas.com/t5/SAS-Programming/Convert-char-datetime-to-sas-date-format-with-EU-format/m-p/651695#M195561
<P>thanks <a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562">@Kurt_Bremser</a> </P><P>I have ~5 million observations from a dataset that my validation team gives me. I am not an expert at SAS, so I simply copied and pasted a sample. </P><P> </P><P>but from a more general perspective, I did not see how SAS chose US or EU date sequence (mdy or dmy) from the character variable using the any-date-time function. It looks like <a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462">@PGStats</a> answered that. </P>Fri, 29 May 2020 12:25:42 GMThttps://communities.sas.com/t5/SAS-Programming/Convert-char-datetime-to-sas-date-format-with-EU-format/m-p/651695#M195561yelkenli2020-05-29T12:25:42ZRe: Convert char datetime to sas date format with EU format
https://communities.sas.com/t5/SAS-Programming/Convert-char-datetime-to-sas-date-format-with-EU-format/m-p/651221#M195362
<P>Thanks <a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892">@PaigeMiller</a>. Code is as above in my first post, which did not work, and then I tried the code from from <a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462">@PGStats</a> sans the first datastep, and changing only the table and variable name in the second to point to my table. </P><P> </P><P> </P><P>here are some of the observations in that variable (March 1rst): </P><BLOCKQUOTE><P>01/03/2020 00:00:00,000<BR />01/03/2020 00:00:01,000<BR />01/03/2020 00:00:02,000<BR />01/03/2020 00:00:03,000<BR />01/03/2020 00:00:04,000<BR />01/03/2020 00:00:05,000<BR />01/03/2020 00:00:06,000<BR />01/03/2020 00:00:07,000<BR />01/03/2020 00:00:08,000<BR />01/03/2020 00:00:09,000<BR />01/03/2020 00:00:10,000</P></BLOCKQUOTE><P> </P><P>Thanks <a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/268518">@DavePrinsloo</a> </P><P>I will look further at the 8601 formats. my table is from a colleague in the EU. </P><P> </P><P> </P>Wed, 27 May 2020 21:14:26 GMThttps://communities.sas.com/t5/SAS-Programming/Convert-char-datetime-to-sas-date-format-with-EU-format/m-p/651221#M195362yelkenli2020-05-27T21:14:26ZRe: Convert char datetime to sas date format with EU format
https://communities.sas.com/t5/SAS-Programming/Convert-char-datetime-to-sas-date-format-with-EU-format/m-p/651055#M195290
<P><a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462">@PGStats</a> </P><P>Can you swap your two outputs and see if you get these results? I think SAS is reading the first line and determining where the month and day are, and applying that format to all rows. This is similar to the risk you get when importing data without controlling the format, SAS will use the first n observations to assign a format</P><PRE><CODE class=" language-sas">data have;
mydatetimeStr = '01/03/2020 15:48:20,000'; output;
mydatetimeStr = '28/02/2020 15:48:20,000'; output;
run;</CODE></PRE><P>with your code I get: </P><BLOCKQUOTE>mydatetimeStr myDate <TABLE><TBODY><TR><TD>01/03/2020 15:48:20,000</TD><TD>2020-01-03</TD></TR><TR><TD>28/02/2020 15:48:20,000</TD><TD>2020-02-28</TD></TR></TBODY></TABLE></BLOCKQUOTE><P>When I ran it with my table, I got the year 1960. </P><BLOCKQUOTE><DIV class=" dgrid-row dgrid-row-even ui-state-default"><TABLE><TBODY><TR><TD>1</TD><TD>01/03/2020 00:00:00,000</TD><TD>01JAN60:06</TD><TD> </TD></TR></TBODY></TABLE></DIV><DIV class=" dgrid-row dgrid-row-odd ui-state-default"><TABLE><TBODY><TR><TD>2</TD><TD>01/03/2020 00:00:01,000</TD><TD>01JAN60:06</TD><TD> </TD></TR></TBODY></TABLE></DIV><DIV class=" dgrid-row dgrid-row-even ui-state-default dgrid-selected ui-state-active"><TABLE><TBODY><TR><TD>3</TD><TD>01/03/2020 00:00:02,000</TD><TD>01JAN60:06</TD></TR></TBODY></TABLE></DIV></BLOCKQUOTE><P>maybe there is some hidden special character in my data? </P><P>I get the same result if I strip out the ,000</P>Wed, 27 May 2020 12:07:24 GMThttps://communities.sas.com/t5/SAS-Programming/Convert-char-datetime-to-sas-date-format-with-EU-format/m-p/651055#M195290yelkenli2020-05-27T12:07:24ZConvert char datetime to sas date format with EU format
https://communities.sas.com/t5/SAS-Programming/Convert-char-datetime-to-sas-date-format-with-EU-format/m-p/650850#M195196
<P>I see many threads and documentation on this subject, but cannot find the correct input format for my problem. </P><P>My date time format in $CHAR23. is '28/02/2020 15:48:20,000'</P><P>the ',000' portion is not needed, so I can strip that out --> '28/02/2020 15:48:20'</P><P>Can someone point me to the correct method to translate this to a sas date time? the any-datetime method does not work as it gives Jan 3 for 01/03/2020 (should be March 1) and February 28 for 28/02/2020 in the same dataset. otherwise it returns without error. </P><P> </P><PRE><CODE class=" language-sas">data want (keep=mydatetime datetime tadt);
set have;
datetime=substr(mydatetime,1,19);
tadt=input(datetime, anydtdtm19.);
format tadt datetime19.;
run;</CODE></PRE><P>i have tried also with MMDDYY19. after stripping out the backslashes. </P>Tue, 26 May 2020 17:32:12 GMThttps://communities.sas.com/t5/SAS-Programming/Convert-char-datetime-to-sas-date-format-with-EU-format/m-p/650850#M195196yelkenli2020-05-26T17:32:12Zmacro variable value as observation value in a new column proc sql create table
https://communities.sas.com/t5/SAS-Programming/macro-variable-value-as-observation-value-in-a-new-column-proc/m-p/621334#M182658
<P>I have a macro variable that I would like to use as the observation values in a new column in a proc sql table. </P><P>The macro variable is &_size, and group&size and above&size are columns in the table 'mydata'. the proc sql creates two columns, and I want a third that has the same value which is the macro variable value. </P><P> </P><P>in a normal proc sql, i would put: ' ' as new-column, </P><P>But in a macro, I don't know how to do this. I don't use macros much. below it is ???&_size as mySize . I have tried with single quotes also. </P><P> </P><P>here is what I pass into the macro (which works great without my attempt at creating the new column based on the macro variable:</P><P>%sizeEval( sizeLevel=1500, _size=_15 );</P><P>Here is the opening of the macro:</P><P>%macro sizeEval(sizeLevel=, _size=);</P><P> </P><P>Here is my proc sql in the macro:</P><BLOCKQUOTE><P>create table sustained&_size as<BR />select distinct size, seconds, count(distinct group&_size) as count&_size,<BR />from (select <STRONG>???&_size as mySize</STRONG>, distinct max(above&_size) as seconds, group&_size<BR />from mydata<BR />where above&_size ^= 0<BR />group by group&_size)<BR />group by seconds, <STRONG>size</STRONG><BR />order by seconds</P></BLOCKQUOTE>Thu, 30 Jan 2020 23:05:03 GMThttps://communities.sas.com/t5/SAS-Programming/macro-variable-value-as-observation-value-in-a-new-column-proc/m-p/621334#M182658yelkenli2020-01-30T23:05:03ZRe: Count conditional on continuous value being above a number
https://communities.sas.com/t5/SAS-Programming/Count-conditional-on-continuous-value-being-above-a-number/m-p/606557#M176145
<P>The first part works great. I changed the if-then-else block however to this construct: </P><P> </P><P>above_42 = ifn(speed>= 15, above_42 + 1,0);<BR />above_55 = ifn(speed>= 40, above_55 + 1,0);</P><P> </P><P>what is the purpose of "if missing(above_42) then above_42=0;</P><P>I would have expected this to be 'if missing the speed variable, then set the counter = 0'. </P><P> </P><P>everything else is the same. Thanks!</P><P> </P><P> </P><P> </P>Fri, 22 Nov 2019 19:50:08 GMThttps://communities.sas.com/t5/SAS-Programming/Count-conditional-on-continuous-value-being-above-a-number/m-p/606557#M176145yelkenli2019-11-22T19:50:08ZCount conditional on continuous value being above a number
https://communities.sas.com/t5/SAS-Programming/Count-conditional-on-continuous-value-being-above-a-number/m-p/606353#M176065
<P>I have a time series of values (e.g. speed of a car) and I want to understand the number of times that value exceeds a number for certain durations (e.g. "exceeded 55mph for more than 8 seconds" occurred 5 times during this 10 hour trip. </P><P> </P><P>In excel I created a column that started counting when the value was above 55, and then reset to 0 when it fell below again. I created a second column that took the difference of the prior row and current row of that first calculated count column, which gave the highest number in each series plus a bunch of -1 values. Ignoring the -1 and 0 values, I can then get my desired count. </P><P> </P><P>The full data set is too large for excel and i would prefer to run this in SAS, and in a data step, though Proc SQL is good also. </P><P> </P><P>The excel method works, but I am stumped on how to get that first counting column that resets to zero when the continuous variable falls below the threshold. I don't think first. and last. would work, but maybe with an if/then statement? I am not sure how to reset an if/then count. </P><P>Assuming the excel method is a good path, how do I get that first counting column? </P><P> </P><P>raw data example</P><TABLE><TBODY><TR><TD>date_time</TD><TD>speed</TD><TD>Count above 55</TD><TD>count above 42</TD></TR><TR><TD>11DEC16:23:53:21</TD><TD> 35.00</TD><TD>0</TD><TD>0</TD></TR><TR><TD>11DEC16:23:53:22</TD><TD> 39.00</TD><TD>0</TD><TD>0</TD></TR><TR><TD>11DEC16:23:53:23</TD><TD> 45.00</TD><TD>0</TD><TD>1</TD></TR><TR><TD>11DEC16:23:53:24</TD><TD> 55.00</TD><TD>1</TD><TD>2</TD></TR><TR><TD>11DEC16:23:53:25</TD><TD> 56.00</TD><TD>2</TD><TD>3</TD></TR><TR><TD>11DEC16:23:53:26</TD><TD> 58.00</TD><TD>3</TD><TD>4</TD></TR><TR><TD>11DEC16:23:53:27</TD><TD> 56.00</TD><TD>4</TD><TD>5</TD></TR><TR><TD>11DEC16:23:53:28</TD><TD> 55.00</TD><TD>5</TD><TD>6</TD></TR><TR><TD>11DEC16:23:53:29</TD><TD> 50.00</TD><TD>0</TD><TD>7</TD></TR><TR><TD>11DEC16:23:53:30</TD><TD> 40.00</TD><TD>0</TD><TD>0</TD></TR><TR><TD>11DEC16:23:53:31</TD><TD> 53.00</TD><TD>0</TD><TD>1</TD></TR><TR><TD>11DEC16:23:53:32</TD><TD> 55.00</TD><TD>1</TD><TD>2</TD></TR><TR><TD>11DEC16:23:53:33</TD><TD> 56.00</TD><TD>2</TD><TD>3</TD></TR><TR><TD>11DEC16:23:53:34</TD><TD> 58.00</TD><TD>3</TD><TD>4</TD></TR></TBODY></TABLE><P> </P><P>the final product would look like: </P><P> </P><TABLE><TBODY><TR><TD>Number of times above55, sustained for xx seconds</TD></TR><TR><TD>xx</TD><TD>counts</TD></TR><TR><TD>1</TD><TD> </TD></TR><TR><TD>2</TD><TD> </TD></TR><TR><TD>3</TD><TD>1</TD></TR><TR><TD>4</TD><TD> </TD></TR><TR><TD>5</TD><TD>1</TD></TR><TR><TD>6</TD><TD> </TD></TR><TR><TD>7</TD><TD> </TD></TR><TR><TD>8</TD><TD> </TD></TR><TR><TD>9</TD><TD> </TD></TR><TR><TD>10</TD><TD> </TD></TR></TBODY></TABLE><P> </P><TABLE><TBODY><TR><TD>Number of times above 42, sustained for xx seconds</TD></TR><TR><TD>xx</TD><TD>counts</TD></TR><TR><TD>1</TD><TD> </TD></TR><TR><TD>2</TD><TD> </TD></TR><TR><TD>3</TD><TD> </TD></TR><TR><TD>4</TD><TD>1</TD></TR><TR><TD>5</TD><TD> </TD></TR><TR><TD>6</TD><TD> </TD></TR><TR><TD>7</TD><TD>1</TD></TR><TR><TD>8</TD><TD> </TD></TR><TR><TD>9</TD><TD> </TD></TR><TR><TD>10</TD><TD> </TD></TR></TBODY></TABLE><P> </P><P> </P>Fri, 22 Nov 2019 01:14:44 GMThttps://communities.sas.com/t5/SAS-Programming/Count-conditional-on-continuous-value-being-above-a-number/m-p/606353#M176065yelkenli2019-11-22T01:14:44ZRe: Update query no longer working
https://communities.sas.com/t5/SAS-Programming/Update-query-no-longer-working/m-p/537112#M147658
<P>I found the error. It is the use of variable names with a space. I thought I fixed that but was not looking closely enough. </P><P> </P><P> </P>Wed, 20 Feb 2019 15:42:05 GMThttps://communities.sas.com/t5/SAS-Programming/Update-query-no-longer-working/m-p/537112#M147658yelkenli2019-02-20T15:42:05ZUpdate query no longer working
https://communities.sas.com/t5/SAS-Programming/Update-query-no-longer-working/m-p/537104#M147652
<P> </P><P>I have a simple update query that worked in the past but does not now. expects an "=", but i am sure if have it in there. any idea what i am doing wrong?</P><P> </P><PRE><CODE class=" language-sas">PROC SQL;
update sasuser.parts as u
set u.part_system = (select sf.Subsystem FROM sasuser.whereused sf where u.pnum=sf.part number)
where missing(u.'part_system'n);
quit;</CODE></PRE><P> </P><P> </P><BLOCKQUOTE><DIV class="sasSource"> </DIV><DIV class="sasSource">1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;</DIV><DIV class="sasSource">55</DIV><DIV class="sasSource">56 PROC SQL;</DIV><DIV class="sasSource">57 update sasuser.parts as u</DIV><DIV class="sasSource">58 set u.part_system = (select sf.Subsystem</DIV><DIV class="sasError">_</DIV><DIV class="sasError">73</DIV><DIV class="sasError">76</DIV><DIV class="sasError">ERROR 73-322: Expecting an =.</DIV><DIV class="sasSource"> </DIV><DIV class="sasError">ERROR 76-322: Syntax error, statement will be ignored.</DIV><DIV class="sasSource"> </DIV><DIV class="sasSource">59 FROM sasuser.whereused sf</DIV><DIV class="sasSource">60 where u.pnum=sf.part number)</DIV><DIV class="sasSource">61 where missing(u.'part_system'n);</DIV><DIV class="sasNote">NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.</DIV><DIV class="sasSource">62 quit;</DIV><DIV class="sasNote">NOTE: The SAS System stopped processing this step because of errors.</DIV><DIV class="sasNote">NOTE: PROCEDURE| _DISARM| STOP| _DISARM| 2019-02-20T10:19:54,419-05:00| _DISARM| WorkspaceServer| _DISARM| SAS| _DISARM| |</DIV><DIV class="sasNote">_DISARM| 30830592| _DISARM| 30568448| _DISARM| 13| _DISARM| 13| _DISARM| 0| _DISARM| 14464| _DISARM| 0.000000| _DISARM|</DIV><DIV class="sasNote">0.006735| _DISARM| 1866295194.412948| _DISARM| 1866295194.419683| _DISARM| 0.000000| _DISARM| | _ENDDISARM</DIV><DIV class="sasNote">NOTE: PROCEDURE SQL used (Total process time):</DIV><DIV class="sasNote">real time 0.00 seconds</DIV><DIV class="sasNote">cpu time 0.00 seconds</DIV><DIV class="sasNote"> </DIV><DIV class="sasSource">63</DIV><DIV class="sasSource">64 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;</DIV><PRE class="sasLog"> </PRE><P> </P></BLOCKQUOTE>Wed, 20 Feb 2019 15:30:00 GMThttps://communities.sas.com/t5/SAS-Programming/Update-query-no-longer-working/m-p/537104#M147652yelkenli2019-02-20T15:30:00ZRe: Proc print with excel add in and control width of excel columns.
https://communities.sas.com/t5/SAS-Procedures/Proc-print-with-excel-add-in-and-control-width-of-excel-columns/m-p/533618#M73834
<P>ballardw: </P><P>Thanks for replying. the SAS excel add-in tool appears to not use all of the SAS coding controls, as this did not work (similar result as my other forum thread). If anyone uses the excel add-in, please chime in. Any suggestions are appreciated. </P>Thu, 07 Feb 2019 15:25:14 GMThttps://communities.sas.com/t5/SAS-Procedures/Proc-print-with-excel-add-in-and-control-width-of-excel-columns/m-p/533618#M73834yelkenli2019-02-07T15:25:14ZRe: Proc print and control vertical justify to Top
https://communities.sas.com/t5/SAS-Procedures/Proc-print-and-control-vertical-justify-to-Top/m-p/533372#M73827
<P>This did not work. I also tried changing the excel default justification, and tried some different formats in the cells. It seems the SAS proc print overwrites the cell justify styles, though not font and cell colors. There is an option to use raw values only, but I have dollar and comma formats I do not want to lose. </P><P> </P><P>Again, this is running SAS code in an excel add-in. </P>Wed, 06 Feb 2019 19:48:14 GMThttps://communities.sas.com/t5/SAS-Procedures/Proc-print-and-control-vertical-justify-to-Top/m-p/533372#M73827yelkenli2019-02-06T19:48:14ZProc print with excel add in and control width of excel columns.
https://communities.sas.com/t5/SAS-Procedures/Proc-print-with-excel-add-in-and-control-width-of-excel-columns/m-p/533092#M73808
<P>I use an excel SAS add-in that let's me run SAS code. I develop the code in SAS Studio. The resulting dataset in the excel worksheet has some very wide column widths. The wide columns are for variables with lengths of 12,000 for free form entry. I do not want to truncate any of the text. </P><P> </P><P>Is there control the column width in excel?</P><P> </P><PRE><CODE class=" language-sas">Proc print data=mydata;
Run;</CODE></PRE>Tue, 05 Feb 2019 22:07:43 GMThttps://communities.sas.com/t5/SAS-Procedures/Proc-print-with-excel-add-in-and-control-width-of-excel-columns/m-p/533092#M73808yelkenli2019-02-05T22:07:43ZProc print and control vertical justify to Top
https://communities.sas.com/t5/SAS-Procedures/Proc-print-and-control-vertical-justify-to-Top/m-p/533087#M73806
<P>I use an excel SAS add-in that let's me run SAS code. I develop the code in SAS Studio. The resulting dataset in the excel worksheet is bottom justified. I would like it to be top justified. Right and left look good and are per standard. </P><P> </P><P>Is there a way to define the justification as Top?</P><P> </P><PRE><CODE class=" language-sas">Proc print data=mydata;
Run;</CODE></PRE>Tue, 05 Feb 2019 21:52:18 GMThttps://communities.sas.com/t5/SAS-Procedures/Proc-print-and-control-vertical-justify-to-Top/m-p/533087#M73806yelkenli2019-02-05T21:52:18Zconcatenate week(sasdate) in a string and retain leading zero for weeks 01 to 09
https://communities.sas.com/t5/New-SAS-User/concatenate-week-sasdate-in-a-string-and-retain-leading-zero-for/m-p/531709#M5924
<P>i am having trouble with a simple format need. </P><P>My first attempt (which was with CATS and no PUT statement) resulted in single digit weeks for weeks 1 through 9. </P><P>The below results in a single digit week number with a blank space where a zero should be. The rest of data manipulations work but I would prefer to have the zero. </P><P>The remaining data manipulations provide a table showing a volume over a time line by week (across years, etc.). a second path might be to skip creating this variable and present the data some other way but I have not see that alternate path. so help with keeping the zero is appreciated. </P><P> </P><P> </P><PRE><CODE class=" language-sas">create table want AS
SELECT
some variables
,CAT('Yr', year(datepart(a_date)) , 'FW', put(week(datepart(a_date),'v'), 2.) ) AS FW_filter
from atable;
</CODE></PRE><P> </P><P> </P><P>results are as such:</P><P>Yr2017FW 1</P><P>Yr2017FW 2</P><P>etc.</P><P> </P><P>would like </P><P>Yr2017FW01</P><P>Yr2017FW02</P>Thu, 31 Jan 2019 16:42:24 GMThttps://communities.sas.com/t5/New-SAS-User/concatenate-week-sasdate-in-a-string-and-retain-leading-zero-for/m-p/531709#M5924yelkenli2019-01-31T16:42:24ZFormat transpose
https://communities.sas.com/t5/SAS-Programming/Format-transpose/m-p/528152#M144104
<P>I use Proc Transpose on a data set that results in column headers that are fiscal weeks. The weeks extend back a year and are updated each week. I would like to format the data in the new table without listing the new columns explicitly. </P><P>I have several more queries after the transpose and refer to the transpose table columns using ' * '. </P><P>Is there a way to format the VAR data?</P><P> </P><P> </P><P> </P><PRE><CODE class=" language-sas">ROC TRANSPOSE DATA=have OUT=want;
BY type_code;
VAR money_spent;
ID Fiscal_week;
RUN;</CODE></PRE>Thu, 17 Jan 2019 20:52:04 GMThttps://communities.sas.com/t5/SAS-Programming/Format-transpose/m-p/528152#M144104yelkenli2019-01-17T20:52:04Z