<?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 How do I: Loop through the data to build a timestamp string. in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-Loop-through-the-data-to-build-a-timestamp-string/m-p/25716#M188</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do not know anything about SAS Enterprise Data Management &amp;amp; Integration, but if you want a data step to generate a macro variable use CALL SYMPUTX in place of your PUT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call symputx('vcid',case_id);&lt;/P&gt;&lt;P&gt;call symputx('vtstamp',timestamp);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that this will only work correctly when there is only one observation.&lt;/P&gt;&lt;P&gt;If there are mulitple observations then only the last value will remain in the macro variable as the previous values will have been overwritten.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Oct 2011 23:08:53 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2011-10-12T23:08:53Z</dc:date>
    <item>
      <title>How do I: Loop through the data to build a timestamp string.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-Loop-through-the-data-to-build-a-timestamp-string/m-p/25708#M180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In DIS I need to loop through records and build a string with date and time from a table that stores date and time in two separate rows. Query on a unique CID will always fetch 3 rows. Here is the sample data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" height="168" style="width: 467px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="background-color: silver; padding: 0.75pt;" width="59"&gt; &lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG style="font-size: 8pt; font-family: 'Times New Roman','serif';"&gt;CID&lt;/STRONG&gt;&lt;/P&gt;&amp;nbsp; &lt;/TD&gt;&lt;TD style="background-color: silver; padding: 0.75pt;" width="55"&gt; &lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG style="font-size: 8pt; font-family: 'Times New Roman','serif';"&gt;PGID&lt;/STRONG&gt;&lt;/P&gt;&amp;nbsp; &lt;/TD&gt;&lt;TD style="background-color: silver; padding: 0.75pt;" width="34"&gt; &lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG style="font-size: 8pt; font-family: 'Times New Roman','serif';"&gt;ELID&lt;/STRONG&gt;&lt;/P&gt;&amp;nbsp; &lt;/TD&gt;&lt;TD style="background-color: silver; padding: 0.75pt;" width="167"&gt; &lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG style="font-size: 8pt; font-family: 'Times New Roman','serif';"&gt;EV&lt;/STRONG&gt;&lt;/P&gt;&amp;nbsp; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0.75pt;" width="59"&gt; &lt;P align="right" style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman','serif'; font-size: 8pt;"&gt;212673&lt;/SPAN&gt;&lt;/P&gt;&amp;nbsp; &lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0.75pt;" width="55"&gt; &lt;P align="right" style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman','serif'; font-size: 8pt;"&gt;509279&lt;/SPAN&gt;&lt;/P&gt;&amp;nbsp; &lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0.75pt;" width="34"&gt; &lt;P align="right" style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman','serif'; font-size: 8pt;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&amp;nbsp; &lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0.75pt;" width="167"&gt; &lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman','serif'; font-size: 8pt;"&gt;Turn On&amp;nbsp; or Off Water Service Line&lt;/SPAN&gt;&lt;/P&gt;&amp;nbsp; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0.75pt;" width="59"&gt; &lt;P align="right" style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman','serif'; font-size: 8pt;"&gt;212673&lt;/SPAN&gt;&lt;/P&gt;&amp;nbsp; &lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0.75pt;" width="55"&gt; &lt;P align="right" style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman','serif'; font-size: 8pt;"&gt;509281&lt;/SPAN&gt;&lt;/P&gt;&amp;nbsp; &lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0.75pt;" width="34"&gt; &lt;P align="right" style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman','serif'; font-size: 8pt;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&amp;nbsp; &lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0.75pt;" width="167"&gt; &lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman','serif'; font-size: 8pt;"&gt;13 Oct&amp;nbsp; 2011&lt;/SPAN&gt;&lt;/P&gt;&amp;nbsp; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0.75pt;" width="59"&gt; &lt;P align="right" style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman','serif'; font-size: 8pt;"&gt;212673&lt;/SPAN&gt;&lt;/P&gt;&amp;nbsp; &lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0.75pt;" width="55"&gt; &lt;P align="right" style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman','serif'; font-size: 8pt;"&gt;509281&lt;/SPAN&gt;&lt;/P&gt;&amp;nbsp; &lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0.75pt;" width="34"&gt; &lt;P align="right" style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman','serif'; font-size: 8pt;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&amp;nbsp; &lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0.75pt;" width="167"&gt; &lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman','serif'; font-size: 8pt;"&gt;10&lt;/SPAN&gt;&lt;/P&gt;&amp;nbsp; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I like to do is to ignore the first row and walk through the other two rows and grab the EV values (&lt;SPAN style="font-family: 'Times New Roman','serif'; font-size: 8pt;"&gt;13 Oct&amp;nbsp; 2011) and (10) to build an entire timestamp string like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Times New Roman','serif'; font-size: 8pt;"&gt;13-OCT-2011 10:00:00. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;Time is always stored in hours.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;Any hints and help are much appreciated.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2011 14:12:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-Loop-through-the-data-to-build-a-timestamp-string/m-p/25708#M180</guid>
      <dc:creator>Halaku</dc:creator>
      <dc:date>2011-10-07T14:12:59Z</dc:date>
    </item>
    <item>
      <title>How do I: Loop through the data to build a timestamp string.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-Loop-through-the-data-to-build-a-timestamp-string/m-p/25709#M181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Halaku,&amp;nbsp; Unfortunately I'm not familiar with either EG or DIS but, if you can do it in a datastep, you could use something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat EV $50.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format thedate date9.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format datetime datetime21.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain last_ev;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input CID PGID ELID EV &amp;amp;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if input(ev, ?? anydtdte21.) gt 0 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; thedate=input(ev, anydtdte21.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; last_ev=thedate;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if last_ev and input(ev,?? 2.) gt 0 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datetime=input(catt(put(last_ev,date9.),":",input(ev,2.),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ":00:00"),anydtdtm21.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call missing(last_ev);&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;212673 509279 1 Turn On or Off Water Service Line&lt;/P&gt;&lt;P&gt;212673 509281 1 13 Oct 2011&lt;/P&gt;&lt;P&gt;212673 509281 2 10&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2011 14:42:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-Loop-through-the-data-to-build-a-timestamp-string/m-p/25709#M181</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-10-07T14:42:37Z</dc:date>
    </item>
    <item>
      <title>How do I: Loop through the data to build a timestamp string.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-Loop-through-the-data-to-build-a-timestamp-string/m-p/25710#M182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, there is no transform available in dis that will do this for you "out of the box".&lt;/P&gt;&lt;P&gt;Probably the easiest is to use code such as Art's in a user written transform.&lt;/P&gt;&lt;P&gt;Given the prerequisite that the table is sorted by CID &amp;amp;amp; PGID, then you could do the following:&lt;/P&gt;&lt;P&gt;- use extract with group by and a having that filters out min(PGID).&lt;/P&gt;&lt;P&gt;- transpose transform to get date and hour on the same row.&lt;/P&gt;&lt;P&gt;- any transform that let's you define expressions (extract, sql join or table loader).&lt;/P&gt;&lt;P&gt;Linus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Oct 2011 11:37:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-Loop-through-the-data-to-build-a-timestamp-string/m-p/25710#M182</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2011-10-08T11:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I: Loop through the data to build a timestamp string.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-Loop-through-the-data-to-build-a-timestamp-string/m-p/25711#M183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure that I understand the structure that you are trying to read.&amp;nbsp; But if the date is always on the row where pgid=509281 and elid=1 and the hour is always on the row where pgid=509281 and elid=2 then you can just merge those rows back together so that you can build a datetime value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; input cid pgid elid ev $50.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;cards;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;212673 509279 1 Turn On or Off Water Service Line&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;212673 509281 1 13 Oct 2011&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;212673 509281 2 10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data want ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; merge have(where=(pgid=509281 and elid=1) rename=ev=cdate)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; have(where=(pgid=509281 and elid=2) rename=ev=chour)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; by cid;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; timestamp = input(compress(cdate||':'||chour||':00:00'),anydtdtm.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; format timestamp datetime.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; put cid= timestamp=;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Oct 2011 14:05:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-Loop-through-the-data-to-build-a-timestamp-string/m-p/25711#M183</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-10-08T14:05:09Z</dc:date>
    </item>
    <item>
      <title>How do I: Loop through the data to build a timestamp string.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-Loop-through-the-data-to-build-a-timestamp-string/m-p/25712#M184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Halaku,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From what data source are you querying?&amp;nbsp; If you're querying a relational database like MySQL, Oracle, etc, some of these databases have specialized functions that allow you to concatenate strings across rows.&amp;nbsp; If your source is such a database, you could accomplish this by turning on passthrough in the SQL Query transformation.&amp;nbsp; If this is not the case, I agree with the previous posts that the solution would be to use the User Written Code node and write a SAS program that takes advantage of retain variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2011 16:22:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-Loop-through-the-data-to-build-a-timestamp-string/m-p/25712#M184</guid>
      <dc:creator>TimStearn_SASProductManagement_</dc:creator>
      <dc:date>2011-10-10T16:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I: Loop through the data to build a timestamp string.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-Loop-through-the-data-to-build-a-timestamp-string/m-p/25713#M185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to all who replied. I am extracting the data from Oracle and need to post is to SQL server. Transpose seems to be a good choice as I am not very much into SAS programming yet. Will appreciate if some one can get a simple approach to this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And if I am writing my own Transformation how do I connect to the output from previous transformation result ( say EXTRACT) and to output to other transformation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 17:07:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-Loop-through-the-data-to-build-a-timestamp-string/m-p/25713#M185</guid>
      <dc:creator>Halaku</dc:creator>
      <dc:date>2011-10-11T17:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I: Loop through the data to build a timestamp string.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-Loop-through-the-data-to-build-a-timestamp-string/m-p/25714#M186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The easiest thing is to just create libnames that point to your external databases. Then you can access your database tables as if they were SAS datasets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;libname oracle oracle user=testuser password=testpass path=hrdept_002;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;libname sqlsvr sqlsvr user=testuser password=testpass;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier;"&gt;data sqlsrv.want ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier;"&gt;&amp;nbsp; merge oracle.have(where=(pgid=509281 and elid=1) rename=ev=cdate)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oracle.have(where=(pgid=509281 and elid=2) rename=ev=chour)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier;"&gt;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier;"&gt;&amp;nbsp; by cid;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier;"&gt;&amp;nbsp; timestamp = input(compress(cdate||':'||chour||':00:00'),anydtdtm.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier;"&gt;&amp;nbsp; format timestamp datetime.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 17:49:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-Loop-through-the-data-to-build-a-timestamp-string/m-p/25714#M186</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-10-11T17:49:12Z</dc:date>
    </item>
    <item>
      <title>How do I: Loop through the data to build a timestamp string.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-Loop-through-the-data-to-build-a-timestamp-string/m-p/25715#M187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I created a Generated Transformation (GT) with the following code and it is runing successfully as it returns values through my put ... statement at the end. However, despite I have checked the boxes for Input/Output tab for both input and output macro variables, I am unable to pass the values for cid and tstamp to my next transformation which is a dataloader. I'll appreciate help in mapping the values to output work table. If you need details I can do and export of the job and submit screenshots as well.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt; set &amp;amp;SYSLAST;&lt;/P&gt;&lt;P&gt;&amp;nbsp; merge &amp;amp;syslast(where=(element_id=1) rename=value=cdate)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;syslast(where=(element_id=2) rename=value=chour)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by case_id;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; timestamp = input(compress(cdate||':'||chour||':00:00'),anydtdtm.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; format timestamp datetime.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*put timestamp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; vcid=case_id;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; vtstamp=timestamp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; put vcid vtstamp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 19:04:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-Loop-through-the-data-to-build-a-timestamp-string/m-p/25715#M187</guid>
      <dc:creator>Halaku</dc:creator>
      <dc:date>2011-10-12T19:04:48Z</dc:date>
    </item>
    <item>
      <title>How do I: Loop through the data to build a timestamp string.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-Loop-through-the-data-to-build-a-timestamp-string/m-p/25716#M188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do not know anything about SAS Enterprise Data Management &amp;amp; Integration, but if you want a data step to generate a macro variable use CALL SYMPUTX in place of your PUT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call symputx('vcid',case_id);&lt;/P&gt;&lt;P&gt;call symputx('vtstamp',timestamp);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that this will only work correctly when there is only one observation.&lt;/P&gt;&lt;P&gt;If there are mulitple observations then only the last value will remain in the macro variable as the previous values will have been overwritten.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 23:08:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-Loop-through-the-data-to-build-a-timestamp-string/m-p/25716#M188</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-10-12T23:08:53Z</dc:date>
    </item>
  </channel>
</rss>

