<?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 to import SAS Programme in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-SAS-Programme/m-p/244604#M45581</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to import a sas program i.e .SAS file,The output dataset should have text between the ; [semicolan] as observations,&lt;/P&gt;&lt;P&gt;Any help on this is much appriciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ex: data hello; set hello1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; x=a+b;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;/* calculated field*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output : &amp;nbsp;data hello;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set hello1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x= a+b;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;/* calculated field*/ &amp;nbsp;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jan 2016 07:18:19 GMT</pubDate>
    <dc:creator>lokeshbm</dc:creator>
    <dc:date>2016-01-20T07:18:19Z</dc:date>
    <item>
      <title>How to import SAS Programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-SAS-Programme/m-p/244604#M45581</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to import a sas program i.e .SAS file,The output dataset should have text between the ; [semicolan] as observations,&lt;/P&gt;&lt;P&gt;Any help on this is much appriciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ex: data hello; set hello1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; x=a+b;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;/* calculated field*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output : &amp;nbsp;data hello;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set hello1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x= a+b;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;/* calculated field*/ &amp;nbsp;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 07:18:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-SAS-Programme/m-p/244604#M45581</guid>
      <dc:creator>lokeshbm</dc:creator>
      <dc:date>2016-01-20T07:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to import SAS Programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-SAS-Programme/m-p/244609#M45584</link>
      <description>&lt;P&gt;Perhaps you could explain why you wish to do this?&lt;/P&gt;
&lt;P&gt;But it seems you could just use the whole input record using the automatic _infile_variable, assign to a char variable.&lt;/P&gt;
&lt;P&gt;In your example, it seems you wish to split records. That can be done, but there are some traps. Like if you have a ; within a character constant (and does not point out end of SAS program line).&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 07:43:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-SAS-Programme/m-p/244609#M45584</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-01-20T07:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to import SAS Programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-SAS-Programme/m-p/244614#M45585</link>
      <description>&lt;P&gt;Hi, My objective is to seperate/output the calculated variables from the code.So if i am able to split the code in to records between ; semicolan,I can further apply some conditions and output only those. In this case I want to output only x=a+b.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 07:56:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-SAS-Programme/m-p/244614#M45585</guid>
      <dc:creator>lokeshbm</dc:creator>
      <dc:date>2016-01-20T07:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to import SAS Programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-SAS-Programme/m-p/244637#M45597</link>
      <description>&lt;P&gt;As i said, it can be quite cumbersome to split records, since ; can occur not only for end of statement. macro for instance.&lt;/P&gt;
&lt;P&gt;And then you have SQL, which would probably look awful with this logic.&lt;/P&gt;
&lt;P&gt;If you want to document all calculations, you might be a candidate for using a metadata ETL tool, like DI Studio.&lt;/P&gt;
&lt;P&gt;You can use scan() and substr() functions with explicit output statement to split records.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 10:00:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-SAS-Programme/m-p/244637#M45597</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-01-20T10:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to import SAS Programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-SAS-Programme/m-p/244640#M45598</link>
      <description>&lt;P&gt;I totally agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13674"&gt;@LinusH﻿&lt;/a&gt;. &amp;nbsp;What you are attempting to do is in part like the SAS compiler. &amp;nbsp;You will need to do a lot of work to make this run, and at the end of the day is it worth it. &amp;nbsp;Following on from SDLC, you will have defined a Functional Design Specification, which details what the program does, outputs etc. &amp;nbsp;This document is the specification, you program from that and test against it. &amp;nbsp;Why do this, well, the reason is because you are now trying to fit the specification and testing around code you have written. &amp;nbsp;It is all kinds of problems, and wouldn't be considered validated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Simply put:&lt;/P&gt;
&lt;P&gt;Specification, document, review, program, test, release, lifecycle.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 10:18:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-SAS-Programme/m-p/244640#M45598</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-01-20T10:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to import SAS Programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-SAS-Programme/m-p/246054#M45993</link>
      <description>&lt;P&gt;Thanks for your prompt reply.I know this is bit complicated and awful,but If I can output/cover 60 to 70% of the calculated variables that are created in the code that should do and I need this for documentation purpose.&lt;/P&gt;&lt;P&gt;I have imported the code and split the text between ; [semicolan] in to observations. I am now trying to create a loop which checks and cleans the&amp;nbsp;data leaving the calculated fields.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure this is the best approach,Any suggesitions or help or code [with some sample examples]&amp;nbsp;on this highly appiciated as I have to submit the code asap.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 07:18:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-SAS-Programme/m-p/246054#M45993</guid>
      <dc:creator>lokeshbm</dc:creator>
      <dc:date>2016-01-26T07:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to import SAS Programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-SAS-Programme/m-p/246064#M45994</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your statements are at odds though. &amp;nbsp;What is the purpose of this "documentation"? &amp;nbsp;Is it for some sort of QC, if so then it fails straight away as documenting what it does is not QC. &amp;nbsp;What do you mean by "submit the code"? &amp;nbsp;&lt;/P&gt;
&lt;P&gt;To be honest if you have to do this, then I would suggest going through each program and working out what it is doing. &amp;nbsp;As I mentioned before, it is very complicated, what consititutes a calculated variable? &amp;nbsp;Do loops can create variables, functions, arrays, retain, length, attrib statements etc. &amp;nbsp;Strings could be more complicated, especically if they have used excplicit conversion techniques (input). &amp;nbsp;How will you get calculated variables from procedures, say means for example.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 09:27:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-SAS-Programme/m-p/246064#M45994</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-01-26T09:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to import SAS Programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-SAS-Programme/m-p/246297#M46058</link>
      <description>&lt;P&gt;What you said is right its getting complicated and&amp;nbsp;&lt;SPAN&gt;complicated.What i meant by&amp;nbsp;"submit the code" is to share the code to the testing team.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;As you suggested going through each program and working out what it is doing&lt;/STRONG&gt;&lt;/EM&gt; :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you give an example for a basic data step for the above please?.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Lokesh&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2016 08:36:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-SAS-Programme/m-p/246297#M46058</guid>
      <dc:creator>lokeshbm</dc:creator>
      <dc:date>2016-01-27T08:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to import SAS Programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-SAS-Programme/m-p/246302#M46059</link>
      <description>&lt;P&gt;Its not a programmed approach I am suggesting. &amp;nbsp;It requires a programmer to manually go through the code and understand it. &amp;nbsp;It simply comes from the failure to document things prior to programming. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Remember for the future:&lt;/P&gt;
&lt;P&gt;Document, document, document, program, test, document, cycle.&lt;/P&gt;
&lt;P&gt;Documentation is far more important than programming.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2016 09:03:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-SAS-Programme/m-p/246302#M46059</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-01-27T09:03:37Z</dc:date>
    </item>
  </channel>
</rss>

