<?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: How to define the output of %sysexec into a variable so that it can be used in later part of pro in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-define-the-output-of-sysexec-into-a-variable-so-that-it/m-p/529994#M5629</link>
    <description>&lt;P&gt;Read the return string into a dataset using infile and a pipe, for instance:&lt;/P&gt;
&lt;PRE&gt;filename tmp pipe '/opt/CARK... GetPassword...';

data want;
  length return_string $2000;
  infile tmp;
  input return_string $;
run;&lt;/PRE&gt;
&lt;P&gt;Then you have a dataset with the required information, and if needed you can call symput from that datastep to get it into a macro variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suppose the one question I would ask is why your changing passwords via SAS, using command line?&amp;nbsp; Surely the application in question is better suited to doing such tasks, or linking active directory or something similar to do consolidated password management.&lt;/P&gt;</description>
    <pubDate>Fri, 25 Jan 2019 09:32:55 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2019-01-25T09:32:55Z</dc:date>
    <item>
      <title>How to define the output of %sysexec into a variable so that it can be used in later part of program</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-define-the-output-of-sysexec-into-a-variable-so-that-it/m-p/529993#M5628</link>
      <description>&lt;P&gt;I have already used this piece of code to get the password for one of DB id. But I cannot define the output of the below %sysexec&amp;nbsp;to a variable so that I can used the same in later part of my sas code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro pwdls;&lt;/P&gt;&lt;P&gt;%sysexec %str(/opt/CARKaim/sdk/clipasswordsdk GetPassword -p AppDescs.AppID=DIAL -p Query="safe=chbs_test;Folder=Root;Object=Test-XXXXXXX-XXX-XXX" -p FailRequestOnPasswordChange=false -o Password);&lt;/P&gt;&lt;P&gt;&amp;nbsp;%mend pwdls;&lt;/P&gt;&lt;P&gt;As soon as I call the macro I am getting the as below:&lt;/P&gt;&lt;P&gt;%pwdls;&lt;BR /&gt;TDFR6_67fuuwr91&lt;/P&gt;&lt;P&gt;But I want this output to be captured inside a variable. How can I do that.&lt;/P&gt;&lt;P&gt;I tried using the below piece but I am getting error as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;42?&amp;nbsp; %macro pwdls;&lt;BR /&gt;&amp;nbsp;43?&amp;nbsp; %let a=%sysexec %str(/opt/CARKaim/sdk/clipasswordsdk GetPassword -p AppDescs.AppID=DIAL -p Query="safe=chbs_test;Folder=Root;Object=Test-XXXX-XXX-XXX" -p FailRequestOnPasswordChange=false -o Password);&lt;/P&gt;&lt;P&gt;ERROR: Macro keyword SYSEXEC appears as text.&lt;BR /&gt;ERROR: A dummy macro will be compiled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 09:12:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-define-the-output-of-sysexec-into-a-variable-so-that-it/m-p/529993#M5628</guid>
      <dc:creator>Piyanka</dc:creator>
      <dc:date>2019-01-25T09:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to define the output of %sysexec into a variable so that it can be used in later part of pro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-define-the-output-of-sysexec-into-a-variable-so-that-it/m-p/529994#M5629</link>
      <description>&lt;P&gt;Read the return string into a dataset using infile and a pipe, for instance:&lt;/P&gt;
&lt;PRE&gt;filename tmp pipe '/opt/CARK... GetPassword...';

data want;
  length return_string $2000;
  infile tmp;
  input return_string $;
run;&lt;/PRE&gt;
&lt;P&gt;Then you have a dataset with the required information, and if needed you can call symput from that datastep to get it into a macro variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suppose the one question I would ask is why your changing passwords via SAS, using command line?&amp;nbsp; Surely the application in question is better suited to doing such tasks, or linking active directory or something similar to do consolidated password management.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 09:32:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-define-the-output-of-sysexec-into-a-variable-so-that-it/m-p/529994#M5629</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-01-25T09:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to define the output of %sysexec into a variable so that it can be used in later part of pro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-define-the-output-of-sysexec-into-a-variable-so-that-it/m-p/530034#M5639</link>
      <description>Thanks a lot. I could get the desired result.</description>
      <pubDate>Fri, 25 Jan 2019 12:48:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-define-the-output-of-sysexec-into-a-variable-so-that-it/m-p/530034#M5639</guid>
      <dc:creator>Piyanka</dc:creator>
      <dc:date>2019-01-25T12:48:17Z</dc:date>
    </item>
  </channel>
</rss>

