<?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: Reading a mainframe PDS (SAS Library) using a sas program in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-mainframe-PDS-SAS-Library-using-a-sas-program/m-p/720141#M223055</link>
    <description>&lt;P&gt;Please post the log so that we can see what happened.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Feb 2021 10:19:58 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2021-02-18T10:19:58Z</dc:date>
    <item>
      <title>Reading a mainframe PDS (SAS Library) using a sas program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-mainframe-PDS-SAS-Library-using-a-sas-program/m-p/717565#M221928</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to read a Mainframe PDS which is having SAS Program members in it by passing the PDS using a JCL. I have to read one by one and have to get the creation date and user_id as highlighted in below snap.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="THALLA_REDDY_0-1612791589239.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54453iFE264A51FA2C41A6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="THALLA_REDDY_0-1612791589239.png" alt="THALLA_REDDY_0-1612791589239.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Please help me with the SAS Code logic for the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks in advance&lt;/P&gt;
&lt;P&gt;thalla&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 13:41:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-mainframe-PDS-SAS-Library-using-a-sas-program/m-p/717565#M221928</guid>
      <dc:creator>THALLA_REDDY</dc:creator>
      <dc:date>2021-02-08T13:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a mainframe PDS (SAS Library) using a sas program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-mainframe-PDS-SAS-Library-using-a-sas-program/m-p/717577#M221932</link>
      <description>&lt;P&gt;I no longer have access to a mainframe to test my code, but something like this should work:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   /* Assign a fileref to the PDS */
   _rc=filename("myPDS","mydata.my.pdsfile");
   _did=dopen("myPDS");
   if _did ne 0 then do;
      putlog "ERROR: Unable to open PDS to look at members";
      _rc=filename("myPDS");
      stop;
   end;
   do _i=1 to dnum(did);&lt;BR /&gt;      /* Get info for each PDS member */
      MemberName=dread(did,i);
      _rc=filename("thisMem",cats("myPDS(",MemberName,")","S");
      _fid=fopen("thisMem");
      do _j=1 to foptnum(_fid);
         infoname=foptname(_fid,_j);
         infovalue=finfo(_fid,infoname);
         output;
      end;
      _rc=fclose(_fid);
      _rc=filename("thisMem");
   end;
   _rc=dclose(_did);
   _rc=filename("myPDS");
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this at least gets you started &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 14:30:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-mainframe-PDS-SAS-Library-using-a-sas-program/m-p/717577#M221932</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2021-02-08T14:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a mainframe PDS (SAS Library) using a sas program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-mainframe-PDS-SAS-Library-using-a-sas-program/m-p/717810#M222045</link>
      <description>thanks, this really helps me to get started</description>
      <pubDate>Tue, 09 Feb 2021 08:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-mainframe-PDS-SAS-Library-using-a-sas-program/m-p/717810#M222045</guid>
      <dc:creator>THALLA_REDDY</dc:creator>
      <dc:date>2021-02-09T08:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a mainframe PDS (SAS Library) using a sas program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-mainframe-PDS-SAS-Library-using-a-sas-program/m-p/720134#M223052</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am getting return code 1 instead of zero with this code. Can anyone help me to move forward on this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks,&lt;/P&gt;
&lt;P&gt;Thalla&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2021 08:55:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-mainframe-PDS-SAS-Library-using-a-sas-program/m-p/720134#M223052</guid>
      <dc:creator>THALLA_REDDY</dc:creator>
      <dc:date>2021-02-18T08:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a mainframe PDS (SAS Library) using a sas program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-mainframe-PDS-SAS-Library-using-a-sas-program/m-p/720141#M223055</link>
      <description>&lt;P&gt;Please post the log so that we can see what happened.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2021 10:19:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-mainframe-PDS-SAS-Library-using-a-sas-program/m-p/720141#M223055</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-02-18T10:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a mainframe PDS (SAS Library) using a sas program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-mainframe-PDS-SAS-Library-using-a-sas-program/m-p/720850#M223337</link>
      <description>&lt;P&gt;Hi This is the code that I have created&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OPTIONS MISSING = ' ' SYMBOLGEN; &lt;BR /&gt;&lt;BR /&gt;%LET PDSNAME = %ADDTICKS(testpds.jcllib); &lt;BR /&gt;&lt;BR /&gt;DATA PDSCHK; &lt;BR /&gt;_RC = FILENAME("MYPDS",&amp;amp;PDSNAME); &lt;BR /&gt;_DID = DOPEN("MYPDS"); &lt;BR /&gt;IF _DID NE 0 THEN DO; &lt;BR /&gt;PUTLOG "ERROR: UNABLE TO OPEN PDS TO LOOK MEMBERS IN IT"; &lt;BR /&gt;_RC = FILENAME("MYPDS"); &lt;BR /&gt;/* STOP; */ &lt;BR /&gt;END; &lt;BR /&gt;ELSE DO; &lt;BR /&gt;PUTLOG "PDS opened successfully"; &lt;BR /&gt;END; &lt;BR /&gt;DO _I = 1 TO DNUM(_DID); &lt;BR /&gt;MEMBERNAME = DREAD(_DID,I); &lt;BR /&gt;_RC = FILENAME("THISMEM",CATS("MYPDS(",MEMBERNAME,")","S")); &lt;BR /&gt;_FID = FOPEN("THISMEM");&lt;/P&gt;
&lt;P&gt;DO _J = 1 TO FOPTNUM(_FID); &lt;BR /&gt;INFONAME = FOPTNAME(_FID,_J); &lt;BR /&gt;INFOVALUE = FINFO(_FID,INFONAME); &lt;BR /&gt;OUTPUT; &lt;BR /&gt;END; &lt;BR /&gt;_RC = FCLOSE(_FID); &lt;BR /&gt;_RC = FILENAME("THISMEM"); &lt;BR /&gt;END; &lt;BR /&gt;_RC = DCLOSE(_DID); &lt;BR /&gt;_RC = FILENAME("MYPDS"); &lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The log is&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: Variable I is uninitialized. &lt;BR /&gt;ERROR: UNABLE TO OPEN PDS TO LOOK MEMBERS IN IT &lt;BR /&gt;NOTE: Argument 2 to function DREAD(1, ) at line 41 column 19 is invalid.&lt;BR /&gt;NOTE: Argument 1 to function FOPTNUM(0) at line 44 column 19 is invalid. &lt;BR /&gt;ERROR: Invalid DO loop control information, either the INITIAL or TO expression is missing or the BY expression is missing, zero,&amp;nbsp;or invalid. &lt;BR /&gt;_RC=20002 _DID=1 _I=1 MEMBERNAME= I= _FID=0 _J=1 INFONAME= INFOVALUE= _ERROR_=1 _N_=1&amp;nbsp;&lt;BR /&gt;NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to missing values. &lt;BR /&gt;Each place is given by: (Number of times) at (Line):(Column). &lt;BR /&gt;1 at 44:19&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 08:08:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-mainframe-PDS-SAS-Library-using-a-sas-program/m-p/720850#M223337</guid>
      <dc:creator>THALLA_REDDY</dc:creator>
      <dc:date>2021-02-22T08:08:50Z</dc:date>
    </item>
  </channel>
</rss>

