<?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: Read member from one PDS and write on another based on condition in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Read-member-from-one-PDS-and-write-on-another-based-on-condition/m-p/469586#M120150</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76464"&gt;@s_lassen&lt;/a&gt;&amp;nbsp;Thanks for pointing things Lassen. But it didn't work after correcting those things. I'm almost done on this and will share the code once it is completed.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jun 2018 11:46:39 GMT</pubDate>
    <dc:creator>Mano3116</dc:creator>
    <dc:date>2018-06-12T11:46:39Z</dc:date>
    <item>
      <title>Read member from one PDS and write on another based on condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-member-from-one-PDS-and-write-on-another-based-on-condition/m-p/469245#M119993</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a PDS 'userid.myname.other' with 3000 members I want to read all the members of that pds and write it in to a new PDS. I have few conditions for writing the members.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Conditions: 1. all the members have a particular name say sasexe on a fixed column but the row may varies. I want to start writing the members only when after sasexe all the lines before that has to be omitted.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2.&amp;nbsp; Likewise writing the output file has to be stopped when the when another keyword is encountered which is also common in all the members.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm attaching my sample code here. which is not working as expected. Can someone help me out on this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;code:&lt;/P&gt;&lt;P&gt;DATA TST1;&lt;BR /&gt;LENGTH FILENAME $40.;&lt;BR /&gt;INFILE FILE01;&lt;BR /&gt;INPUT @1 PGM $8.;&lt;BR /&gt;Inp_NAME = "input.file.name(" ||TRIM(PGM)|| ")";&lt;BR /&gt;out_NAME = "output.file.name(" ||TRIM(PGM)|| ")";&lt;BR /&gt;RUN;&lt;BR /&gt;DATA REC_OT(KEEP=REC);&lt;/P&gt;&lt;P&gt;LENGTH MYINFILE $400.;&lt;BR /&gt;SET TST1;&lt;BR /&gt;INFILE INDUMMY FILEVAR=Inp_NAME FILENAME=MYINFILE END=DONE;&lt;BR /&gt;DO WHILE(NOT DONE);&lt;BR /&gt;INPUT @1 REC $CHAR80.&lt;BR /&gt;@3 JOB $CHAR8.&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/70859"&gt;@12&lt;/a&gt;JOB1 $CHAR4.;&lt;BR /&gt;INDIC=0;&lt;BR /&gt;INDIR=2;&lt;BR /&gt;IF (INDEX (JOB,"sasexe" ) &amp;gt; 0) THEN DO;&lt;BR /&gt;FILE OUTDUMMY FILEVAR=Out_NAME OLD;&lt;BR /&gt;PUT @1 REC;&lt;BR /&gt;IF (INDEX (JOB1,"EXEC") &amp;gt;0) THEN DO;&lt;BR /&gt;INDIC = INDIC+1;&lt;BR /&gt;END;&lt;BR /&gt;IF (INDIC = INDIR) THEN DO;&lt;BR /&gt;PUT "//*******";&lt;BR /&gt;DONE=1;&lt;BR /&gt;END;&lt;BR /&gt;END;&lt;/P&gt;&lt;P&gt;END;&lt;BR /&gt;FILE MESSAGES NOPRINT;&lt;BR /&gt;PUT 'FINISHED READING ' MYINFILE=;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 11:45:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-member-from-one-PDS-and-write-on-another-based-on-condition/m-p/469245#M119993</guid>
      <dc:creator>Mano3116</dc:creator>
      <dc:date>2018-06-12T11:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Read member from one PDS and write on another based on condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-member-from-one-PDS-and-write-on-another-based-on-condition/m-p/469252#M119998</link>
      <description>&lt;P&gt;What is a PDS?&lt;/P&gt;
&lt;P&gt;Please provide test data in the form of a datastep in a code window (its the {i} above the post):&lt;/P&gt;
&lt;P&gt;&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;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please also provide what you expect to see from that test data.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please also avoid coding all in uppercase, its like shouting.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 14:13:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-member-from-one-PDS-and-write-on-another-based-on-condition/m-p/469252#M119998</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-11T14:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Read member from one PDS and write on another based on condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-member-from-one-PDS-and-write-on-another-based-on-condition/m-p/469258#M120001</link>
      <description>&lt;P&gt;Sorry for the Caps. Since we are working on Mainframe SAS I cannot avoid it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PDS is partitioned dataset which is used in mainframe as a folder. I will rephrase my question.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lets just consider a single file with 5 paragraphs.&amp;nbsp; I want to write a code to copy only the para that starts with SASEXE and ends with EXEC.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 14:22:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-member-from-one-PDS-and-write-on-another-based-on-condition/m-p/469258#M120001</guid>
      <dc:creator>Mano3116</dc:creator>
      <dc:date>2018-06-11T14:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Read member from one PDS and write on another based on condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-member-from-one-PDS-and-write-on-another-based-on-condition/m-p/469259#M120002</link>
      <description>&lt;P&gt;From all I infer, it's about mainframe partitioned datasets, which also explains the uppercase coding. Although not necessary, many MF coders are still stuck in the 1950's.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd get hold a of a good JCL programmer and do it with MF text processing tools.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 14:25:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-member-from-one-PDS-and-write-on-another-based-on-condition/m-p/469259#M120002</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-11T14:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Read member from one PDS and write on another based on condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-member-from-one-PDS-and-write-on-another-based-on-condition/m-p/469519#M120130</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp; Yes, It can be done using JCLs but I have started learning SAS and would like to give a try using this SAS.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We can assume my input like this for Opensource SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Jobstep4...... Hello all nice to learn sas ..... exec.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Jobstep...... Hello all welcome to sas ..... exec.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Jobstep2...... Hello everyone welcome to sas.... exec&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Jobstep.6..... Hello all sas is good ..... exec.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;lets assume all the lines above are paragraphs and I need the para that starts with Jobstep2 and ends with exec .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 06:14:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-member-from-one-PDS-and-write-on-another-based-on-condition/m-p/469519#M120130</guid>
      <dc:creator>Mano3116</dc:creator>
      <dc:date>2018-06-12T06:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Read member from one PDS and write on another based on condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-member-from-one-PDS-and-write-on-another-based-on-condition/m-p/469562#M120146</link>
      <description>&lt;P&gt;I can see a couple of errors in your code:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;You forgot a left paranthesis in&amp;nbsp;&lt;SPAN&gt;"output.file.name" ||TRIM(PGM)|| ")";&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;You put your filenames in INP_NAME and OUT_NAME, but your FILEVAR variables are named IDS_NAME and ODS_NAME&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Not sure if that is enough to accomplish what you want, but it may help.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 10:41:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-member-from-one-PDS-and-write-on-another-based-on-condition/m-p/469562#M120146</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2018-06-12T10:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Read member from one PDS and write on another based on condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-member-from-one-PDS-and-write-on-another-based-on-condition/m-p/469586#M120150</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76464"&gt;@s_lassen&lt;/a&gt;&amp;nbsp;Thanks for pointing things Lassen. But it didn't work after correcting those things. I'm almost done on this and will share the code once it is completed.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 11:46:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-member-from-one-PDS-and-write-on-another-based-on-condition/m-p/469586#M120150</guid>
      <dc:creator>Mano3116</dc:creator>
      <dc:date>2018-06-12T11:46:39Z</dc:date>
    </item>
  </channel>
</rss>

