<?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: Need help with writting out a file to a dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/390992#M93850</link>
    <description>&lt;P&gt;Right, good to check and i did check, I do not have anything for column @164.&lt;/P&gt;</description>
    <pubDate>Fri, 25 Aug 2017 18:38:59 GMT</pubDate>
    <dc:creator>saslovethemost</dc:creator>
    <dc:date>2017-08-25T18:38:59Z</dc:date>
    <item>
      <title>Need help with writting out a file to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/390983#M93848</link>
      <description>&lt;P&gt;I am having a weird issue with the space in place of zeros for a varaible when I write out to a mf dataset.&amp;nbsp;I get a variable and its value calling a IMS db in a data step, I am using&amp;nbsp;same variable in another data step and the same varaible when I write out to a mainframe dataset&amp;nbsp; is changing to a space.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Following is the sas code i used..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;,,
  infile intxn;
  input&lt;BR /&gt;    @001 txns_rec $238.&lt;BR /&gt;    @001 srvcr    $6.
    @007 lnno     $9.
...
...
...
   @161 slrname  $30.
...
...
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I am getting couple of variables&amp;nbsp;(groupno &amp;amp; lnany)&amp;nbsp;from IMS db like below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;***************************************************************;
*  Read XXXXX segment using GU call                          *;
***************************************************************;

 data want;
   set have;
   length SSA1 $60.;

   database="&amp;amp;dbname";
   callfunc='GU  ';
   SSA1='XXXXXX(XXX0010F ='||lnno||')';

   input
    @001 lnno      $9.
    @041 groupno   $7.
    @073 lnany     pd4.6
    ;

   put '--- LNNO#  ---&amp;gt; ' lnno;
   put '--- GROUP# ---&amp;gt; ' groupno;
   put '--- ANY1#  ---&amp;gt; ' lnany;

   if statcode not in ( '  ', 'GE' ) then do;
     put '--- error ---&amp;gt; ' _all_;
     abort return 1111;
   end;
 run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am getting the values like below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;--- LNNO#  ---&amp;gt; 180878298
--- GROUP# ---&amp;gt; F193076
--- ANY1#  ---&amp;gt; 0.05125&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am writitng these out to a dataset like below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;;
*   Write out warning file                                      ;
*&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;;

data _null_;
  set want;
  file wartxn;
       put @001 srvcr    $6.
           @007 lnno     $9.
....
....
....
           @161 groupno  $7.
....
....
....
           @339 lnany    S370FZDT10.9
....
....
....       @374 slrname  $30.
           ;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Follwoing is the output file values (in wartxn)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;groupno value in a output dataset(wartxn):&lt;BR /&gt;&lt;BR /&gt;----+----7--
************
F193 760310W&lt;BR /&gt;&lt;BR /&gt;The above value @161 pos, between F193 and 76 there is a space. it supposed to be F193076 for &lt;BR /&gt;groupno as I printed that value right after IMS db call.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The lenght of output file(wartxn) that I am writting out to in a jcl is different(403) than the input file(238) because I am adding some variables at the end to the file. The interesting thing is when I write the groupno anywhere beyond 238, I do not see this problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I really apprecite your time, thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Neal.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2017 17:24:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/390983#M93848</guid>
      <dc:creator>saslovethemost</dc:creator>
      <dc:date>2017-08-25T17:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with writting out a file to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/390985#M93849</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And it may help to post text output in a codebox using the {i} instead of the run icon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you are writing to specified columns I would very carefully double check that you do not accidently have something that is writing to the wrong column such as&lt;/P&gt;
&lt;PRE&gt;put
           @161 groupno  $7.
....
           @164 othervar $1.  /*&amp;lt;where maybe 264 was intended*/
....
           @339 lnany    S370FZDT10.9
....
....
....       @374 slrname  $30.
&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Aug 2017 17:37:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/390985#M93849</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-25T17:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with writting out a file to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/390992#M93850</link>
      <description>&lt;P&gt;Right, good to check and i did check, I do not have anything for column @164.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2017 18:38:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/390992#M93850</guid>
      <dc:creator>saslovethemost</dc:creator>
      <dc:date>2017-08-25T18:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with writting out a file to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/391212#M93928</link>
      <description>&lt;P&gt;Do anyone come across this kind of an issue? please let me know, i really appreciat your time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Neal.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2017 11:57:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/391212#M93928</guid>
      <dc:creator>saslovethemost</dc:creator>
      <dc:date>2017-08-28T11:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with writting out a file to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/391239#M93941</link>
      <description>&lt;P&gt;It would help if you post your entire output statement. That would be the best way for others to spot potential overwrites.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2017 14:23:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/391239#M93941</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-08-28T14:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with writting out a file to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/391258#M93944</link>
      <description>&lt;P&gt;And an example data set that shows the same behavior. Dummy data is fine to protect any sensitive information as long as the code and the data replicate the problemn.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2017 15:41:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/391258#M93944</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-28T15:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with writting out a file to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/391259#M93945</link>
      <description>&lt;P&gt;My apologies..&amp;nbsp;I thought zero is converting to spaces..but each&amp;nbsp;character at 165 position is converting to space.I checked every where in my code if any is moving to @165 position. Dont know why..&lt;/P&gt;
&lt;PRE&gt;6----+--
********
5T397 40
5U398 00
0S990 45
0S990 45
8E790 70
8B132 87
91518 20
7H356 33
8E790 70
8B132 87
7B132 87
0AQ44 87
2U000 60
2U000 60
2X341 65
2X341 65
2T397 40
2U398 00
5Q926 02
5BB28 49
5Q926 02
21518 20
51518 20
2H356 33
2H356 33
2BE35 94
2A988 50
2V528 81
1BE35 94
5A998 00
9A998 00&lt;/PRE&gt;
&lt;P&gt;The actual values are like the following...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;T397040
U398100
S990745
S990745
E790470
B132487
1518520
H356133
E790470
B132487
B132487
AQ44887
U000360
U000360
X341565
X341565
T397040
U398100
Q926702
BB28849
Q926702
1518520
1518520
&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Aug 2017 15:52:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/391259#M93945</guid>
      <dc:creator>saslovethemost</dc:creator>
      <dc:date>2017-08-28T15:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with writting out a file to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/391269#M93949</link>
      <description>&lt;P&gt;Art, please find the attached SAS output. I really appreciate your help, thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2017 16:27:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/391269#M93949</guid>
      <dc:creator>saslovethemost</dc:creator>
      <dc:date>2017-08-28T16:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with writting out a file to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/391281#M93958</link>
      <description>I got it, instead of $165, it should be $165. what a bummer!</description>
      <pubDate>Mon, 28 Aug 2017 17:25:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/391281#M93958</guid>
      <dc:creator>saslovethemost</dc:creator>
      <dc:date>2017-08-28T17:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with writting out a file to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/391290#M93963</link>
      <description>&lt;P&gt;Yes, that would do it. However, you've got additional problems as none of the following appear to be in the data you are trying to export:&lt;/P&gt;
&lt;PRE&gt; 151                    @349 ppnltyof $1.
 152                    @350 intbrng  pd6.2
 153                    @356 nintbrng pd6.2
 154                    @362 crtmt    pd6.2
 155                    @368 bic      pd6.2
 156                    @374 slrname  $29.&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2017 17:49:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/391290#M93963</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-08-28T17:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with writting out a file to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/391318#M93974</link>
      <description>&lt;P&gt;Thank you Art, I took care of this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Neal.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2017 20:09:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-writting-out-a-file-to-a-dataset/m-p/391318#M93974</guid>
      <dc:creator>saslovethemost</dc:creator>
      <dc:date>2017-08-28T20:09:22Z</dc:date>
    </item>
  </channel>
</rss>

