<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: simple question about the format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648150#M194091</link>
    <description>Thank you!</description>
    <pubDate>Fri, 15 May 2020 20:13:16 GMT</pubDate>
    <dc:creator>olgazabelinasas</dc:creator>
    <dc:date>2020-05-15T20:13:16Z</dc:date>
    <item>
      <title>simple question about the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648005#M194004</link>
      <description>&lt;P&gt;Hello everyone! I will be very grateful if you help solve the problem.&lt;BR /&gt;I have two macro variables.&lt;BR /&gt;They look like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="olgazabelinasas_0-1589545599679.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39467iFCD134526260A13A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="olgazabelinasas_0-1589545599679.png" alt="olgazabelinasas_0-1589545599679.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I want to create two new macro variables that should look exactly like this:&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;'29JAN16:11:07:33'dt&lt;/STRONG&gt;&lt;/U&gt;&amp;nbsp;and &lt;U&gt;&lt;STRONG&gt;'29JAN16:14:21:01'dt&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;Is it possible? and if yes, please give the code&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 12:29:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648005#M194004</guid>
      <dc:creator>olgazabelinasas</dc:creator>
      <dc:date>2020-05-15T12:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: simple question about the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648008#M194006</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/328117"&gt;@olgazabelinasas&lt;/a&gt;&amp;nbsp; Not sure if I am missing some puzzle here. Isn't this supposed to be as simple as&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

%let date_start=29JAN16:11:07:33;

%let date_start_new=%bquote('&amp;amp;date_start'dt);

%put &amp;amp;=date_start_new;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The same for the date_end. I am lazy to type&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 12:37:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648008#M194006</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-05-15T12:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: simple question about the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648012#M194010</link>
      <description>sorry, it is not work &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;</description>
      <pubDate>Fri, 15 May 2020 12:41:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648012#M194010</guid>
      <dc:creator>olgazabelinasas</dc:creator>
      <dc:date>2020-05-15T12:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: simple question about the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648014#M194012</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;I want to create two new macro variables that should look exactly like this:&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;'29JAN16:11:07:33'dt&lt;/STRONG&gt;&lt;/U&gt;&amp;nbsp;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;&lt;STRONG&gt;'29JAN16:14:21:01'dt&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Macro variables, in general, should not be formatted. They should be numbers, not human readable text strings like above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;sorry, it is not work&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;DIV id="tinyMceEditorPaigeMiller_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;Well, it should work. Show us what you did, and show us the LOG from SAS (the entire log for this part of your code, including the code, the WARNINGs, and the ERRORs), and explain what did work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 12:44:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648014#M194012</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-05-15T12:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: simple question about the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648015#M194013</link>
      <description>&lt;P&gt;what does not work?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the log:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;822  %let date_start=29JAN16:11:07:33;
823
824  %let date_start_new=%bquote('&amp;amp;date_start'dt);
825
826  %put &amp;amp;=date_start_new;
DATE_START_NEW='29JAN16:11:07:33'dt
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 May 2020 12:46:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648015#M194013</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-05-15T12:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: simple question about the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648023#M194014</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, at first&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="olgazabelinasas_5-1589547536883.png" style="width: 700px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39474iD0CF370EAE622922/image-dimensions/700x202?v=v2" width="700" height="202" role="button" title="olgazabelinasas_5-1589547536883.png" alt="olgazabelinasas_5-1589547536883.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="olgazabelinasas_1-1589547361940.png" style="width: 463px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39470iF34153E3FE302A50/image-dimensions/463x265?v=v2" width="463" height="265" role="button" title="olgazabelinasas_1-1589547361940.png" alt="olgazabelinasas_1-1589547361940.png" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and i just want to see something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="olgazabelinasas_3-1589547493838.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39472iD379BC27D5FEC837/image-size/medium?v=v2&amp;amp;px=400" role="button" title="olgazabelinasas_3-1589547493838.png" alt="olgazabelinasas_3-1589547493838.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 12:59:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648023#M194014</guid>
      <dc:creator>olgazabelinasas</dc:creator>
      <dc:date>2020-05-15T12:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: simple question about the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648024#M194015</link>
      <description>&lt;P&gt;I have a couple of questions.&lt;/P&gt;
&lt;P&gt;First it is not clear how you generated those photographs from MACRO variables. You don't normally browse macro variables in a tabular presentation like that.&amp;nbsp; Can you just use %PUT to write the values to the log and copy the text from the log (don't take a picture of the text).&lt;/P&gt;
&lt;P&gt;Do you really want single quotes? It would be easier to generate using double quotes since single quotes suppress macro triggers.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put "&amp;amp;date_start"dt "&amp;amp;date_end"dt ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 13:01:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648024#M194015</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-05-15T13:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: simple question about the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648026#M194016</link>
      <description>&lt;P&gt;We need to see the &lt;FONT color="#FF0000"&gt;ENTIRE&lt;/FONT&gt; log of&amp;nbsp; this sequence where you create a macro variable and then try to use it. We do not want you to chop parts out and only show us selected parts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While I can't tell what the error is until I see the entire log, again I repeat that your macro variables should not be formatted. In this case, and any other cases where you compare a SAS date/time or date variable to a macro variable, formatting the macro variable does not help, and often causes the program to fail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For future reference, we don't like to see code or log as screen captures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you signed up for the SAS communities, you should have received an e-mail stressing the importance of providing code in a "code box" which is the running man icon, and providing the log in a "code box" which is the &amp;lt;/&amp;gt; icon. Please follow these guidelines.&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 13:07:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648026#M194016</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-05-15T13:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: simple question about the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648027#M194017</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/328117"&gt;@olgazabelinasas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A slight modification to your code with %unquote to will work for the macro processor to function properly&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
where t1.t_start&amp;lt;=%unquote(&amp;amp;data_s);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;albeit the bigger picture or purpose seems a little misleading&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 13:08:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648027#M194017</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-05-15T13:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: simple question about the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648033#M194023</link>
      <description>&lt;P&gt;Are those dates from 2016 or 1916?&amp;nbsp; Do not use 2 digit years.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note there is a "feature" in the DATETIME format such that to get the 18 character string in style DDMONYYYY:HH:MM:SS with 4 digits for the year you must use a width of 19 in the format specification.&amp;nbsp; DATETIME19.&amp;nbsp; If you use DATETIME18 you get just the 16 character string with only two digits for year like in your example.&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 13:26:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648033#M194023</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-05-15T13:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: simple question about the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648035#M194024</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;since you are using it in Proc SQL you can do it like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;%let date_start=29JAN16:11:07:33;

%let date_start_new="&amp;amp;date_start."dt;

&lt;/LI-CODE&gt;
&lt;P&gt;Bart&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 13:44:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648035#M194024</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-05-15T13:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: simple question about the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648067#M194047</link>
      <description>&lt;P&gt;So it seems like you're trying to make a&amp;nbsp; macro variable match what your code would look like if you were typing it out manually. However, you don't actually need to do that. SAS stores datestimes as numbers, counting the number of seconds from January 1, 1960.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you convert it to an actual SAS datetime variable you can then use that in your code correctly. Ideally you should use the exact datetime format you're using but you can also do this. FYI - depending on how you created this macro variable in the first place it my be a good idea to change how it's stored from the start to avoid this issue entirely.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let date_start = %sysfunc(inputn(29Jan16:11:07:33, anydtdtm.));
....



where t1.datetime &amp;lt;= &amp;amp;date_start;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 May 2020 15:22:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648067#M194047</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-05-15T15:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: simple question about the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648078#M194055</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a couple of questions.&lt;/P&gt;
&lt;P&gt;First it is not clear how you generated those photographs from MACRO variables. You don't normally browse macro variables in a tabular presentation like that.&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Maybe some use of the SASHELP.VMACRO view or the corresponding Dictionary table? Though I agree that looks somewhat suspicious.&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 15:54:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648078#M194055</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-15T15:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: simple question about the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648093#M194065</link>
      <description>&lt;P&gt;See Maxim 28. The raw, unformatted values work best.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 16:39:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648093#M194065</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-15T16:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: simple question about the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648150#M194091</link>
      <description>Thank you!</description>
      <pubDate>Fri, 15 May 2020 20:13:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648150#M194091</guid>
      <dc:creator>olgazabelinasas</dc:creator>
      <dc:date>2020-05-15T20:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: simple question about the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648151#M194092</link>
      <description>Thank you!!!</description>
      <pubDate>Fri, 15 May 2020 20:13:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/simple-question-about-the-format/m-p/648151#M194092</guid>
      <dc:creator>olgazabelinasas</dc:creator>
      <dc:date>2020-05-15T20:13:26Z</dc:date>
    </item>
  </channel>
</rss>

