<?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: Resolve macro variable value in a single line in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528082#M144073</link>
    <description>&lt;P&gt;Based on this program ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;get rid of&amp;nbsp;@@.&amp;nbsp; It's not hurting anything, but it's not helping either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you give your variables a length of $1000, I am tempted to think you might have some long values there ... values that might be affected by the number of characters that SAS will read.&amp;nbsp; So first, try this INFILE statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;infile datalines dlm='|' dsd lrecl=9000;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That will let SAS read beyond the normal (256?) character limit when reading in data.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Jan 2019 16:08:41 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2019-01-17T16:08:41Z</dc:date>
    <item>
      <title>Lost Card message while trying to read one observation dynamically via data lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/527996#M144042</link>
      <description>&lt;P&gt;I have delimiter separated data values that are generated like this:&lt;/P&gt;
&lt;P&gt;abc|def ghi|jkl&lt;/P&gt;
&lt;P&gt;mno|pqr|stu||vw&lt;/P&gt;
&lt;P&gt;x|y|z&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I get all of these into one observation? I also have the the column names in input statement. Can someone please help. Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 12:01:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/527996#M144042</guid>
      <dc:creator>AshleyBright</dc:creator>
      <dc:date>2019-01-17T12:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Card message while trying to read one observation dynamically via data lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528000#M144043</link>
      <description>&lt;P&gt;What do you mean by "one observation"? How many columns should the dataset have, and what should they contain?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 12:37:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528000#M144043</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-01-17T12:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Card message while trying to read one observation dynamically via data lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528002#M144044</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;.&amp;nbsp;Basically, I have column names and column values that are generated dynamically and I pass that as macro variable for a dataset creation. Column values always have data for one row.&lt;/P&gt;
&lt;P&gt;And I pass those values inside a macro variable and when it resolves, it actually spans multiple lines after datalines. But I want that as one row.. I tried @@/truncover but it's not helping.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 12:44:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528002#M144044</guid>
      <dc:creator>AshleyBright</dc:creator>
      <dc:date>2019-01-17T12:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Card message while trying to read one observation dynamically via data lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528004#M144046</link>
      <description>&lt;P&gt;&amp;nbsp;So what should the dataset look like for this input:&lt;/P&gt;
&lt;PRE&gt;abc|def ghi|jkl
mno|pqr|stu||vw
x|y|z&lt;/PRE&gt;
&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 12:46:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528004#M144046</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-01-17T12:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Card message while trying to read one observation dynamically via data lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528005#M144047</link>
      <description>It should look like this:&lt;BR /&gt;&lt;BR /&gt;col1 | col2 | col3 | col4 | col5 | col6 | col7 | col8 | col9 &lt;BR /&gt;abc | def ghi | jkl mno | pqr | stu | | vwx | y | z</description>
      <pubDate>Thu, 17 Jan 2019 12:49:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528005#M144047</guid>
      <dc:creator>AshleyBright</dc:creator>
      <dc:date>2019-01-17T12:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Card message while trying to read one observation dynamically via data lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528007#M144048</link>
      <description>&lt;P&gt;Problem is when the column values resolve from a macro variable it's getting split into new lines within the datalines...&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 12:53:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528007#M144048</guid>
      <dc:creator>AshleyBright</dc:creator>
      <dc:date>2019-01-17T12:53:26Z</dc:date>
    </item>
    <item>
      <title>Resolve macro variable value in a single line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528032#M144057</link>
      <description>&lt;P&gt;I have a macro variable that holds column values that I use after datalines statement. When the macro variable is resolved, I can see that it is splitting into different lines in the log which is causing problem. It should all be read as one single row. Can someone please help. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 14:04:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528032#M144057</guid>
      <dc:creator>AshleyBright</dc:creator>
      <dc:date>2019-01-17T14:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Card message while trying to read one observation dynamically via data lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528033#M144052</link>
      <description>&lt;P&gt;So it seems you have line breaks right within columns, but nothing to recognize them. This cannot be handled reliably.&lt;/P&gt;
&lt;P&gt;The only way one can work around such things is if the "non-natural" line breaks look different form those that actually separate records.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 14:07:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528033#M144052</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-01-17T14:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Card message while trying to read one observation dynamically via data lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528036#M144054</link>
      <description>But it's actually resolving like this during the macro variable resolution.. Is there a way we can resolve the macro variable in one line to make the data step read the dataline as one whole record?</description>
      <pubDate>Thu, 17 Jan 2019 14:10:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528036#M144054</guid>
      <dc:creator>AshleyBright</dc:creator>
      <dc:date>2019-01-17T14:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Resolve macro variable value in a single line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528042#M144058</link>
      <description>&lt;P&gt;Show us your code. (Click on the running man icon and paste the code into that window. Do not skip this step.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Show us the SASLOG. (Click on the {i} icon and paste the log into that window. Do not skip this step.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 14:20:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528042#M144058</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-01-17T14:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Resolve macro variable value in a single line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528044#M144060</link>
      <description>&lt;P&gt;I merged the two threads with obviously connected questions.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 14:23:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528044#M144060</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-01-17T14:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Card message while trying to read one observation dynamically via data lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528045#M144061</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/42569"&gt;@AshleyBright&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;But it's actually resolving like this during the macro variable resolution.. Is there a way we can resolve the macro variable in one line to make the data step read the dataline as one whole record?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Post your code &amp;amp; log, as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt; requested.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 14:24:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528045#M144061</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-01-17T14:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Card message while trying to read one observation dynamically via data lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528051#M144062</link>
      <description>&lt;P&gt;Two suggestions ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, make sure the INFILE statement uses DSD:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;infile datalines dlm='|' dsd;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, is it possible to simplify the INPUT statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;input (col1-col9) ($);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Get rid of&amp;nbsp;@@, get rid of TRUNCOVER, and be willing to accept a message that SAS went on to a new line when it reached past the end of the current line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that's not possible, you will need to provide an example of the names of the macro variables and what each contains,.&amp;nbsp; You might be able to use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;input (&amp;amp;maclist1. &amp;amp;maclist2. &amp;amp;maclist3.) ($);&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 14:40:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528051#M144062</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-01-17T14:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Resolve macro variable value in a single line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528053#M144063</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro createDS(dsname, colnames, colvalues);

data &amp;amp;dsname;
attrib &amp;amp;colnames length = $1000;
infile datalines dlmstr='|';
input &amp;amp;colnames @@;
datalines;
&amp;amp;colvalues
;
run;

%mend createDS;

data test;
set raw;
call execute('%createDS('||dsn||','||columns||','||values||');');
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Jan 2019 14:43:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528053#M144063</guid>
      <dc:creator>AshleyBright</dc:creator>
      <dc:date>2019-01-17T14:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Card message while trying to read one observation dynamically via data lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528054#M144064</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/42569"&gt;@AshleyBright&lt;/a&gt;&amp;nbsp;Is this what you are after?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
infile cards  dlm='|';
array col(10)$;
input  col(*)  @@;
cards;
abc|def ghi|jkl
mno|pqr|stu||vw
x|y|z
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Jan 2019 14:47:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528054#M144064</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-01-17T14:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: Resolve macro variable value in a single line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528062#M144065</link>
      <description>&lt;P&gt;Macro references are not resolved in datalines, and datalines are not valid in macros. The log will alert you to that.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 15:09:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528062#M144065</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-01-17T15:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Card message while trying to read one observation dynamically via data lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528072#M144069</link>
      <description>But the macro variables are resolving here.. I am just getting lost card message... And is there any other way to achieve dynamic dataset creation?</description>
      <pubDate>Thu, 17 Jan 2019 15:43:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528072#M144069</guid>
      <dc:creator>AshleyBright</dc:creator>
      <dc:date>2019-01-17T15:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Resolve macro variable value in a single line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528082#M144073</link>
      <description>&lt;P&gt;Based on this program ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;get rid of&amp;nbsp;@@.&amp;nbsp; It's not hurting anything, but it's not helping either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you give your variables a length of $1000, I am tempted to think you might have some long values there ... values that might be affected by the number of characters that SAS will read.&amp;nbsp; So first, try this INFILE statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;infile datalines dlm='|' dsd lrecl=9000;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That will let SAS read beyond the normal (256?) character limit when reading in data.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 16:08:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528082#M144073</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-01-17T16:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Resolve macro variable value in a single line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528248#M144146</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;&lt;SPAN&gt;Okay this makes sense.. when I checked the line breaks in macro it was somewhere after 250 characters.. let me try this and tell you how it goes..&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jan 2019 05:37:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528248#M144146</guid>
      <dc:creator>AshleyBright</dc:creator>
      <dc:date>2019-01-18T05:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: Resolve macro variable value in a single line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528249#M144147</link>
      <description>lrecl is not allowed in infile statement... It says "Invalid Context"</description>
      <pubDate>Fri, 18 Jan 2019 05:39:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lost-Card-message-while-trying-to-read-one-observation/m-p/528249#M144147</guid>
      <dc:creator>AshleyBright</dc:creator>
      <dc:date>2019-01-18T05:39:15Z</dc:date>
    </item>
  </channel>
</rss>

