<?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 Validate file column headers for multiple text files in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Validate-file-column-headers-for-multiple-text-files/m-p/811709#M20312</link>
    <description>&lt;P&gt;Hi, and thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I'm using SAS DI Studio 4.905.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currently have a Job that has 3 objects in it in the following order:&lt;/P&gt;&lt;P&gt;-Text File, which is comprised of a header with the columns, and the subsequent lines have rows of data.&lt;/P&gt;&lt;P&gt;-A File Reader transformation, which helps read said file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;-A Data Validation transformation, which will validate that the headers/columns are correct. (Eg: validate that the EMPLID field has a header of "WCU ID". If this is not the case, the program will abort.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, this Job is working fine. It is able to process 1 file at a time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm trying to do is make it work for multiple files. Currently, I have 4 files to process, but it only seems to be doing the validation for the first file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried adding a Loop here and there, but same result. (Most likely I'm doing it wrong.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached screenshots with what I have set up. I have also pasted below the User written body code of the File Reader. Please advise.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc datasets lib = work nolist nowarn memtype = (data view);&lt;BR /&gt;delete WHOZG0KF;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;data work.WHOZG0KF / view = work.WHOZG0KF ;&lt;BR /&gt;infile 'FILE_LOCATION_GOES_HERE/slatetosisupdate*'&lt;BR /&gt;lrecl = 431&lt;BR /&gt;delimiter = '|'&lt;BR /&gt;dsd&lt;BR /&gt;missover&lt;BR /&gt;firstobs = 1&lt;BR /&gt;obs = 1;&lt;BR /&gt;;&lt;BR /&gt;attrib EMPLID length = $11&lt;BR /&gt;format = $11.&lt;BR /&gt;informat = $11.;&lt;BR /&gt;attrib WCU_SLATE_APP_NUM length = $50&lt;BR /&gt;format = $50.&lt;BR /&gt;informat = $50.;&lt;BR /&gt;attrib ACAD_CAREER length = $4&lt;BR /&gt;format = $4.&lt;BR /&gt;informat = $4.;&lt;BR /&gt;attrib ADMIT_TYPE length = $3&lt;BR /&gt;format = $3.&lt;BR /&gt;informat = $3.;&lt;BR /&gt;attrib ACAD_PLAN length = $10&lt;BR /&gt;format = $10.&lt;BR /&gt;informat = $10.;&lt;BR /&gt;attrib HOUSING_INTEREST length = $1&lt;BR /&gt;format = $1.&lt;BR /&gt;informat = $1.;&lt;BR /&gt;attrib WCU_SLATE_EMPLID length = $50&lt;BR /&gt;format = $50.&lt;BR /&gt;informat = $50.;&lt;BR /&gt;attrib WCU_AD_RNL_INDEX length = $5;&lt;BR /&gt;attrib WCU_AD_AWRD_AMT length = $8;&lt;BR /&gt;attrib ADM_APPL_NBR length = $8&lt;BR /&gt;format = $8.&lt;BR /&gt;informat = $8.;&lt;BR /&gt;attrib RECRUITMENT_CAT length = $4&lt;BR /&gt;format = $4.&lt;BR /&gt;informat = $4.;&lt;BR /&gt;attrib WCU_ARTIC_CODE length = $10&lt;BR /&gt;format = $10.&lt;BR /&gt;informat = $10.;&lt;BR /&gt;attrib PROG_ACTION length = $4&lt;BR /&gt;format = $4.&lt;BR /&gt;informat = $4.;&lt;BR /&gt;attrib PROG_REASON length = $4&lt;BR /&gt;format = $4.&lt;BR /&gt;informat = $4.;&lt;BR /&gt;attrib ACTION_DATE length = $18;&lt;BR /&gt;attrib PROG_ACTION_2 length = $4&lt;BR /&gt;format = $4.&lt;BR /&gt;informat = $4.;&lt;BR /&gt;attrib PROG_REASON_2 length = $4&lt;BR /&gt;format = $4.&lt;BR /&gt;informat = $4.;&lt;BR /&gt;attrib ACTION_DT_2 length = $18;&lt;BR /&gt;attrib PROG_ACTION_3 length = $4&lt;BR /&gt;format = $4.&lt;BR /&gt;informat = $4.;&lt;BR /&gt;attrib PROG_REASON_3 length = $4&lt;BR /&gt;format = $4.&lt;BR /&gt;informat = $4.;&lt;BR /&gt;attrib ACTION_DT_3 length = $18;&lt;BR /&gt;attrib EFFSEQ length = $3;&lt;BR /&gt;attrib ERROR length = $1;&lt;BR /&gt;attrib WCU_STU_REC_UPD length = $1;&lt;BR /&gt;attrib DATE1 length = $18;&lt;BR /&gt;&lt;BR /&gt;input EMPLID WCU_SLATE_APP_NUM ACAD_CAREER ADMIT_TYPE ACAD_PLAN&lt;BR /&gt;HOUSING_INTEREST WCU_SLATE_EMPLID WCU_AD_RNL_INDEX WCU_AD_AWRD_AMT&lt;BR /&gt;ADM_APPL_NBR RECRUITMENT_CAT WCU_ARTIC_CODE PROG_ACTION PROG_REASON&lt;BR /&gt;ACTION_DATE PROG_ACTION_2 PROG_REASON_2 ACTION_DT_2 PROG_ACTION_3&lt;BR /&gt;PROG_REASON_3 ACTION_DT_3 EFFSEQ ERROR WCU_STU_REC_UPD DATE1;&lt;BR /&gt;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%rcSet(&amp;amp;syserr);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71161i333D6D89E74D032C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71162iEA8766FC3E186FD6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2.png" alt="2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71163i5C80902B14785743/image-size/medium?v=v2&amp;amp;px=400" role="button" title="3.png" alt="3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="4.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71164i6F09F949A8882DE2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="4.png" alt="4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="5.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71165i8E2F59D38235FB6E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="5.png" alt="5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;</description>
    <pubDate>Thu, 05 May 2022 17:39:23 GMT</pubDate>
    <dc:creator>josh_rodriguez</dc:creator>
    <dc:date>2022-05-05T17:39:23Z</dc:date>
    <item>
      <title>Validate file column headers for multiple text files</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Validate-file-column-headers-for-multiple-text-files/m-p/811709#M20312</link>
      <description>&lt;P&gt;Hi, and thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I'm using SAS DI Studio 4.905.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currently have a Job that has 3 objects in it in the following order:&lt;/P&gt;&lt;P&gt;-Text File, which is comprised of a header with the columns, and the subsequent lines have rows of data.&lt;/P&gt;&lt;P&gt;-A File Reader transformation, which helps read said file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;-A Data Validation transformation, which will validate that the headers/columns are correct. (Eg: validate that the EMPLID field has a header of "WCU ID". If this is not the case, the program will abort.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, this Job is working fine. It is able to process 1 file at a time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm trying to do is make it work for multiple files. Currently, I have 4 files to process, but it only seems to be doing the validation for the first file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried adding a Loop here and there, but same result. (Most likely I'm doing it wrong.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached screenshots with what I have set up. I have also pasted below the User written body code of the File Reader. Please advise.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc datasets lib = work nolist nowarn memtype = (data view);&lt;BR /&gt;delete WHOZG0KF;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;data work.WHOZG0KF / view = work.WHOZG0KF ;&lt;BR /&gt;infile 'FILE_LOCATION_GOES_HERE/slatetosisupdate*'&lt;BR /&gt;lrecl = 431&lt;BR /&gt;delimiter = '|'&lt;BR /&gt;dsd&lt;BR /&gt;missover&lt;BR /&gt;firstobs = 1&lt;BR /&gt;obs = 1;&lt;BR /&gt;;&lt;BR /&gt;attrib EMPLID length = $11&lt;BR /&gt;format = $11.&lt;BR /&gt;informat = $11.;&lt;BR /&gt;attrib WCU_SLATE_APP_NUM length = $50&lt;BR /&gt;format = $50.&lt;BR /&gt;informat = $50.;&lt;BR /&gt;attrib ACAD_CAREER length = $4&lt;BR /&gt;format = $4.&lt;BR /&gt;informat = $4.;&lt;BR /&gt;attrib ADMIT_TYPE length = $3&lt;BR /&gt;format = $3.&lt;BR /&gt;informat = $3.;&lt;BR /&gt;attrib ACAD_PLAN length = $10&lt;BR /&gt;format = $10.&lt;BR /&gt;informat = $10.;&lt;BR /&gt;attrib HOUSING_INTEREST length = $1&lt;BR /&gt;format = $1.&lt;BR /&gt;informat = $1.;&lt;BR /&gt;attrib WCU_SLATE_EMPLID length = $50&lt;BR /&gt;format = $50.&lt;BR /&gt;informat = $50.;&lt;BR /&gt;attrib WCU_AD_RNL_INDEX length = $5;&lt;BR /&gt;attrib WCU_AD_AWRD_AMT length = $8;&lt;BR /&gt;attrib ADM_APPL_NBR length = $8&lt;BR /&gt;format = $8.&lt;BR /&gt;informat = $8.;&lt;BR /&gt;attrib RECRUITMENT_CAT length = $4&lt;BR /&gt;format = $4.&lt;BR /&gt;informat = $4.;&lt;BR /&gt;attrib WCU_ARTIC_CODE length = $10&lt;BR /&gt;format = $10.&lt;BR /&gt;informat = $10.;&lt;BR /&gt;attrib PROG_ACTION length = $4&lt;BR /&gt;format = $4.&lt;BR /&gt;informat = $4.;&lt;BR /&gt;attrib PROG_REASON length = $4&lt;BR /&gt;format = $4.&lt;BR /&gt;informat = $4.;&lt;BR /&gt;attrib ACTION_DATE length = $18;&lt;BR /&gt;attrib PROG_ACTION_2 length = $4&lt;BR /&gt;format = $4.&lt;BR /&gt;informat = $4.;&lt;BR /&gt;attrib PROG_REASON_2 length = $4&lt;BR /&gt;format = $4.&lt;BR /&gt;informat = $4.;&lt;BR /&gt;attrib ACTION_DT_2 length = $18;&lt;BR /&gt;attrib PROG_ACTION_3 length = $4&lt;BR /&gt;format = $4.&lt;BR /&gt;informat = $4.;&lt;BR /&gt;attrib PROG_REASON_3 length = $4&lt;BR /&gt;format = $4.&lt;BR /&gt;informat = $4.;&lt;BR /&gt;attrib ACTION_DT_3 length = $18;&lt;BR /&gt;attrib EFFSEQ length = $3;&lt;BR /&gt;attrib ERROR length = $1;&lt;BR /&gt;attrib WCU_STU_REC_UPD length = $1;&lt;BR /&gt;attrib DATE1 length = $18;&lt;BR /&gt;&lt;BR /&gt;input EMPLID WCU_SLATE_APP_NUM ACAD_CAREER ADMIT_TYPE ACAD_PLAN&lt;BR /&gt;HOUSING_INTEREST WCU_SLATE_EMPLID WCU_AD_RNL_INDEX WCU_AD_AWRD_AMT&lt;BR /&gt;ADM_APPL_NBR RECRUITMENT_CAT WCU_ARTIC_CODE PROG_ACTION PROG_REASON&lt;BR /&gt;ACTION_DATE PROG_ACTION_2 PROG_REASON_2 ACTION_DT_2 PROG_ACTION_3&lt;BR /&gt;PROG_REASON_3 ACTION_DT_3 EFFSEQ ERROR WCU_STU_REC_UPD DATE1;&lt;BR /&gt;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%rcSet(&amp;amp;syserr);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71161i333D6D89E74D032C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71162iEA8766FC3E186FD6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2.png" alt="2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71163i5C80902B14785743/image-size/medium?v=v2&amp;amp;px=400" role="button" title="3.png" alt="3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="4.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71164i6F09F949A8882DE2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="4.png" alt="4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="5.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71165i8E2F59D38235FB6E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="5.png" alt="5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 17:39:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Validate-file-column-headers-for-multiple-text-files/m-p/811709#M20312</guid>
      <dc:creator>josh_rodriguez</dc:creator>
      <dc:date>2022-05-05T17:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Validate file column headers for multiple text files</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Validate-file-column-headers-for-multiple-text-files/m-p/814080#M20330</link>
      <description>&lt;P&gt;Trying to understand what you are doing.&lt;/P&gt;
&lt;P&gt;This job is for validating the header record, not to import actual data, or?&lt;/P&gt;
&lt;P&gt;Also, I'm wondering how you distinguish the different files, is this an aggergate file location you are pointing to?&lt;/P&gt;
&lt;P&gt;I guess this can be kind of hard to trouble shoot, but I usually try to run it step by step (preferable in Enterpise Guide) and see what happens, and evaluate output from each operation.&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 14:42:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Validate-file-column-headers-for-multiple-text-files/m-p/814080#M20330</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2022-05-18T14:42:02Z</dc:date>
    </item>
  </channel>
</rss>

