<?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: Flow of Data Step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Flow-of-Data-Step/m-p/692862#M211162</link>
    <description>&lt;P&gt;Expand your DATALINES statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile datalines delimiter='|' dsd truncover;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;so that missing values are correctly dealt with.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Oct 2020 13:30:14 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-10-20T13:30:14Z</dc:date>
    <item>
      <title>Flow of Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Flow-of-Data-Step/m-p/692857#M211159</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please refer on the data steps below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;length;&lt;BR /&gt;infile datalines delimiter='|'&amp;nbsp; dsd truncover;&lt;BR /&gt;input job_id return_cd1 Trigger $ Prerequisite $;&lt;BR /&gt;datalines;&lt;BR /&gt;2|0|Exec|&lt;BR /&gt;11|1|Exec|&lt;BR /&gt;7|.|Not Exec|11,2&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data Job_Sch_Merge;&lt;BR /&gt;set have;&lt;BR /&gt;array statuses(1000) _temporary_;&lt;BR /&gt;length pending_job $100;&lt;BR /&gt;statuses(job_id) = return_cd1;&lt;BR /&gt;if find(Trigger,'Not Exec','i') and Prerequisite ne '' then do; /*This will list down pending pre-requisite jobs in pending_job column*/&lt;BR /&gt;do _n_ = 1 to countw(Prerequisite);&lt;BR /&gt;_job = scan(Prerequisite,_n_);&lt;BR /&gt;if statuses(_job) ne 0 then&lt;BR /&gt;pending_job = compress(catx(',',pending_job,_job),,'s');&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;drop _job /*return_cd1*/;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data step&amp;nbsp;Job_Sch_Merge will work fine as long as the&amp;nbsp;Prerequisite of a job_id is above it (see above work.have).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, if work.have is like the dataset below, it will have an issue. May i know how to fix data step&amp;nbsp;Job_Sch_Merge? Thank you in advanced.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;length;&lt;BR /&gt;infile datalines delimiter='|'&amp;nbsp; dsd truncover;&lt;BR /&gt;input job_id return_cd1 Trigger $ Prerequisite $;&lt;BR /&gt;datalines;&lt;BR /&gt;2|0|Exec|&lt;BR /&gt;7|.|Not Exec|11&lt;BR /&gt;11|0|Exec|&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 13:34:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Flow-of-Data-Step/m-p/692857#M211159</guid>
      <dc:creator>iSAS</dc:creator>
      <dc:date>2020-10-20T13:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Flow of Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Flow-of-Data-Step/m-p/692862#M211162</link>
      <description>&lt;P&gt;Expand your DATALINES statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile datalines delimiter='|' dsd truncover;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;so that missing values are correctly dealt with.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 13:30:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Flow-of-Data-Step/m-p/692862#M211162</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-20T13:30:14Z</dc:date>
    </item>
  </channel>
</rss>

