<?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: Validate the record type in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Validate-the-record-type/m-p/597646#M172230</link>
    <description>&lt;P&gt;Hi Patrick, Shmuel&lt;BR /&gt;Thanks for the quick responce please find below complete sas code bez above comments i have some confusion&lt;BR /&gt;(DATA _NULL_;&lt;BR /&gt;&lt;BR /&gt;Format hdrdate $char8.&lt;BR /&gt;hdrtime $char6.;&lt;BR /&gt;&lt;BR /&gt;Format tlrdate $char8.&lt;BR /&gt;tlrtime $char6.;&lt;BR /&gt;&lt;BR /&gt;Format irectype $char1.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iCase_no $Char20.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iLicence_No Z10.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iAddress_1 $Char28.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iAddress_2 $char28.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iAddress_3 $Char28.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iAddress_4 $Char28.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iAddress_5 $Char28.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iPostcode $Char8.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iTitle $Char5.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iInitials $Char18.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iLicensee_nam $Char43.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iPhone_No $Char30.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iNINO $Char10.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i*********** $Char1.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; i*********** $Char8.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i******* $Char8.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i*****idence $Char1.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iBirth_date $char8.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; i********* $Char53.;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Retain debug ' ';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Retain mf_filename;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Retain idatseqd 0;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Retain hdrqty 0;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Retain hdrqtydf 0;&lt;BR /&gt;&lt;BR /&gt;INFILE LSFIPCEI End=EOFACEI Missover dsd dlm=',' truncover;&lt;BR /&gt;&lt;BR /&gt;/* First record will be the header */&lt;BR /&gt;&lt;BR /&gt;If _n_ = 1 then Do;&lt;BR /&gt;Link Chkhdr;&lt;BR /&gt;File saslog;&lt;BR /&gt;put _N_ ' record reached.. running header qty ' hdrqty&lt;BR /&gt;' Date / Time ' hdrdate '/' hdrtime;&lt;BR /&gt;File LSFIPCEH;&lt;BR /&gt;Put ' ' /* Filename */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ' ' /* Filename date */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ' ' /* Seq */&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/214312"&gt;@49&lt;/a&gt;hdrdate $8.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hdrtime $6.&lt;BR /&gt;&amp;nbsp; &amp;nbsp;@63 hdrqty Z8. @;&lt;/P&gt;&lt;P&gt;return;&lt;BR /&gt;End;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; idatseqd + 1;&lt;BR /&gt;&lt;BR /&gt;Input @1 irectype $ @;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;If irectype = 'T' Then Do;&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;File LSFIPCEH;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Input @2 tlrdate $char8.&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/145066"&gt;@10&lt;/a&gt;tlrtime $char4.&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/189370"&gt;@14&lt;/a&gt;tlrqty 8.;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Put @71 tlrdate $Char8.&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; &amp;nbsp; tlrtime $Char6.&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/108029"&gt;@85&lt;/a&gt;tlrqty Z8. ;&lt;/P&gt;&lt;P&gt;end;&lt;BR /&gt;Else Do;&lt;BR /&gt;put 'rec #1' ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FILE LSFIPCEO;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Input iCase_no $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iLicence_No $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iAddress_1 $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iAddress_2 $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iAddress_3 $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iAddress_4 $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iAddress_5 $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iPostcode $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iTitle $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iInitials $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iLicensee_nam $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iPhone_No $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iNINO $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i********** $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i*********** $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I********* $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i**********8 $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i********** $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; i**********88 $;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Put irectype $char1.&lt;BR /&gt;iCase_no $Char20.&lt;BR /&gt;iLicence_No Z10.&lt;BR /&gt;iAddress_1 $Char28.&lt;BR /&gt;iAddress_2 $char28.&lt;BR /&gt;iAddress_3 $Char28.&lt;BR /&gt;iAddress_4 $Char28.&lt;BR /&gt;iAddress_5 $Char28.&lt;BR /&gt;iPostcode $Char8.&lt;BR /&gt;iTitle $Char5.&lt;BR /&gt;iInitials $Char18.&lt;BR /&gt;iLicensee_nam $Char43.&lt;BR /&gt;iPhone_No $Char30.&lt;BR /&gt;iNINO $Char10.&lt;BR /&gt;i*********** $Char1.&lt;BR /&gt;i*********** $Char8.&lt;BR /&gt;i******* $Char8.&lt;BR /&gt;i*****idence $Char1.&lt;BR /&gt;iBirth_date $char8.&lt;BR /&gt;i********* $Char5iPCE_Receipt $Char1.&lt;BR /&gt;&lt;BR /&gt;FIle SASLOG;&lt;BR /&gt;Put irectype=&lt;BR /&gt;iCase_no=&lt;BR /&gt;iLicence_No=&lt;BR /&gt;iAddress_1=&lt;BR /&gt;iAddress_2=&lt;BR /&gt;iAddress_3=&lt;BR /&gt;iAddress_4=&lt;BR /&gt;iAddress_5=&lt;BR /&gt;iPostcode =&lt;BR /&gt;iTitle=&lt;BR /&gt;iInitials=&lt;BR /&gt;iLicensee_nam=&lt;BR /&gt;iPhone_No=&lt;BR /&gt;i****=&lt;BR /&gt;i**********=&lt;BR /&gt;i********=&lt;BR /&gt;i*******t=&lt;BR /&gt;i********=&lt;BR /&gt;i********=&lt;BR /&gt;i***********=;&lt;BR /&gt;End;&lt;BR /&gt;&lt;BR /&gt;Return;&lt;BR /&gt;if irectype not = 'T' Then Do;&lt;BR /&gt;link Chktlr;&lt;BR /&gt;end;&lt;BR /&gt;ChkHdr:&lt;BR /&gt;&lt;BR /&gt;INFILE LSFIACEI End=EOFACEI Missover;&lt;BR /&gt;&lt;BR /&gt;Input @1 Hdrrtyp $char1.&lt;BR /&gt;@2 Hdrdate $char8. /* Header date */&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/145066"&gt;@10&lt;/a&gt;Hdrtime $char4. /* Header time */&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/189370"&gt;@14&lt;/a&gt;hdrqty 8.; /* Records in file */&lt;BR /&gt;&lt;BR /&gt;/* Validate record type */&lt;BR /&gt;&lt;BR /&gt;If Hdrrtyp¬= 'H' Then Do;&lt;BR /&gt;Errcode = 1;&lt;BR /&gt;Link SasAbend;&lt;BR /&gt;End;&lt;BR /&gt;Return;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Chktlr:&lt;BR /&gt;&lt;BR /&gt;INFILE LSFIPCEI End=EOFPCEI Missover;&lt;BR /&gt;&lt;BR /&gt;Input @1 Tlrrtyp $char1.&lt;BR /&gt;@2 Tlrdate $char8. /* Header date */&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/145066"&gt;@10&lt;/a&gt;Tlrtime $char4. /* Header time */&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/189370"&gt;@14&lt;/a&gt;Tlrqty 8.; /* Records in file */&lt;BR /&gt;&lt;BR /&gt;/* Validate record type */&lt;BR /&gt;&lt;BR /&gt;If Tlrrtyp¬= 'T' Then Do;&lt;BR /&gt;Errcode = 11;&lt;BR /&gt;Link SasAbend;&lt;BR /&gt;End;&lt;BR /&gt;&lt;BR /&gt;kindly explain where should i link Chktlr for trailer check&lt;BR /&gt;Thanks &amp;amp; regards&lt;BR /&gt;Rohit&lt;/P&gt;</description>
    <pubDate>Fri, 18 Oct 2019 12:16:09 GMT</pubDate>
    <dc:creator>rohitkrishna</dc:creator>
    <dc:date>2019-10-18T12:16:09Z</dc:date>
    <item>
      <title>Validate the record type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Validate-the-record-type/m-p/597617#M172215</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am getting one error that was meeting with the condition what I passed in the below code&amp;nbsp;&lt;/P&gt;&lt;P&gt;Req: is I have a file it contains header, detail and trailer records and it's in CSV format and I need to make it fixed format and check the record type if it in proper order then the results have been print to outfile, if the record type is not matching with the condition then it has to show the error code please find below the input records&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input Recods in csv format :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;H2019101813450000002&lt;/P&gt;&lt;P&gt;D,case#,brinsten,62005,cafitira,netherlands,&lt;/P&gt;&lt;P&gt;T2019101813450000002 (instead of T place I used given E then it must show the error code in spool)&lt;/P&gt;&lt;P&gt;above the input values&lt;/P&gt;&lt;P&gt;i converted it into fixed format by using format and input and put function&amp;nbsp;&lt;/P&gt;&lt;P&gt;{"moreover i need to split those headers and trailer rec into one file and details rec has to move another file}&lt;/P&gt;&lt;P&gt;kindly give sum suggestion to rectify the error i getting&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{Chktlr:&lt;BR /&gt;&lt;BR /&gt;INFILE LSFIACEI End=EOFPCEI Missover;&lt;BR /&gt;&lt;BR /&gt;Input @1 Tlrrtype $char1.&lt;BR /&gt;@2 Tlrdate $char8. /* Header date */&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/145066"&gt;@10&lt;/a&gt; Tlrtime $char4. /* Header time */&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/189370"&gt;@14&lt;/a&gt; Tlrqty 8.; /* Records in file */&lt;BR /&gt;&lt;BR /&gt;/* Validate record type */&lt;BR /&gt;&lt;BR /&gt;If Tlrrtype¬= 'T' Then Do;&lt;BR /&gt;Errcode = 11;&lt;BR /&gt;Link SasAbend;&lt;BR /&gt;End;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and below the&amp;nbsp; error code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When (11) Do;&lt;BR /&gt;Put '* Expected Records Mismatches Actual read ?.';&lt;BR /&gt;Put '* Expecting (T)railer record as last entry ';&lt;BR /&gt;Put '* in input file. Found record type = ' Tlrrtyp;&lt;BR /&gt;Put '* ';&lt;BR /&gt;Put '* The number of data records read was ';&lt;BR /&gt;Put '* based on the number of expected ';&lt;BR /&gt;Put '* records read from the header.';&lt;BR /&gt;Put '* The header value was : ' Hdrqty;&lt;BR /&gt;End;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but i am not able getting the exact error code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;kindly give the solution for the above code&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;rohit&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 05:51:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Validate-the-record-type/m-p/597617#M172215</guid>
      <dc:creator>rohitkrishna</dc:creator>
      <dc:date>2019-10-18T05:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Validate the record type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Validate-the-record-type/m-p/597622#M172217</link>
      <description>&lt;P&gt;You haven't show the full code nor the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code should look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  infile datalines;
  retain phase; drop phase;
  Input @1  Tlrrtype $char1. @;
  
    if Tlrrtype in ('H', 'T') then 
      input @2  Tlrdate $char8. /* Header or trailer date */
            @10 Tlrtime $char4. /* Header or trailer time */
            @14 Tlrqty 8.       /* Records in file */ 
	    ;
    else 
	if Tlrrtype = 'D' then do;
	   phase = 1;
	   input  &amp;lt;Detail variables &amp;gt; ;
	end; else phase = 2;
		 
   If phase=2 then do;&lt;BR /&gt;      phase=0;
      if Tlrrtype ¬= 'T' Then Do;
         Errcode = 11;
        Link SasAbend;
      End; 
return;
  
SASAbend:
   if errcode = 11 then do;
      Put '* Expected Records Mismatches Actual read ?.';
	  Put '* Expecting (T)railer record as last entry ';
	  Put '* in input file. Found record type = ' Tlrrtyp;
      Put '* ';
 	  Put '* The number of data records read was ';
	  Put '* based on the number of expected ';
	  Put '* records read from the header.';
	  Put '* The header value was : ' Hdrqty;
	End;
return;  /* or call sasabend */	
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;code should look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 06:40:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Validate-the-record-type/m-p/597622#M172217</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2019-10-18T06:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Validate the record type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Validate-the-record-type/m-p/597623#M172218</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/259823"&gt;@rohitkrishna&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below a program structure which makes it eventually a bit easier for you to implement and test the required logic step by step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* create sample data file */
filename LSFIACEI temp lrecl=200;
data _null_;
  file LSFIACEI;
  infile datalines truncover;
  input;
  put _infile_;
  datalines;
H2019101813450000002
D,case#,brinsten,62005,cafitira,netherlands,
D,case#,brinsten,62005,cafitira,netherlands,
T2019101813450000002
;

/* and here some sample code which provides a program structure you could use */
filename outfile temp /*here instead of temp some path and lrecl */ lrecl=300;
data _null_;
  infile LSFIACEI dsd truncover;
  input @1 rec_type $1. @;
  
  /* Data: Most common case so have it first */
  if rec_type='D' then
    do;
      /* read remaining data columns */
      input (var1-var7) (:$20.);
      file outfile;
      /* below have put statement using @n if you want to write data positional to outfile */ 
      put var1-var7;
      return;
    end;

  /* header */
  else
  if rec_type='H' then
    do;
      input /*&amp;lt;header fields&amp;gt;*/;
      /* do stuff - if trailer records are not required then just have above an empty input statement */
      file print;
      put _infile_;
      return;
    end;

  /* trailer */
  else
  if rec_type='T' then
    do;
      /* read remaining data columns */
      input /*&amp;lt;trailer fields&amp;gt;*/;
      /* all your check logic */
      file print;
      put _infile_;
      return;
    end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 Oct 2019 06:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Validate-the-record-type/m-p/597623#M172218</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-10-18T06:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Validate the record type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Validate-the-record-type/m-p/597646#M172230</link>
      <description>&lt;P&gt;Hi Patrick, Shmuel&lt;BR /&gt;Thanks for the quick responce please find below complete sas code bez above comments i have some confusion&lt;BR /&gt;(DATA _NULL_;&lt;BR /&gt;&lt;BR /&gt;Format hdrdate $char8.&lt;BR /&gt;hdrtime $char6.;&lt;BR /&gt;&lt;BR /&gt;Format tlrdate $char8.&lt;BR /&gt;tlrtime $char6.;&lt;BR /&gt;&lt;BR /&gt;Format irectype $char1.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iCase_no $Char20.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iLicence_No Z10.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iAddress_1 $Char28.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iAddress_2 $char28.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iAddress_3 $Char28.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iAddress_4 $Char28.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iAddress_5 $Char28.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iPostcode $Char8.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iTitle $Char5.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iInitials $Char18.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iLicensee_nam $Char43.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iPhone_No $Char30.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iNINO $Char10.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i*********** $Char1.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; i*********** $Char8.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i******* $Char8.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i*****idence $Char1.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iBirth_date $char8.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; i********* $Char53.;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Retain debug ' ';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Retain mf_filename;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Retain idatseqd 0;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Retain hdrqty 0;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Retain hdrqtydf 0;&lt;BR /&gt;&lt;BR /&gt;INFILE LSFIPCEI End=EOFACEI Missover dsd dlm=',' truncover;&lt;BR /&gt;&lt;BR /&gt;/* First record will be the header */&lt;BR /&gt;&lt;BR /&gt;If _n_ = 1 then Do;&lt;BR /&gt;Link Chkhdr;&lt;BR /&gt;File saslog;&lt;BR /&gt;put _N_ ' record reached.. running header qty ' hdrqty&lt;BR /&gt;' Date / Time ' hdrdate '/' hdrtime;&lt;BR /&gt;File LSFIPCEH;&lt;BR /&gt;Put ' ' /* Filename */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ' ' /* Filename date */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ' ' /* Seq */&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/214312"&gt;@49&lt;/a&gt;hdrdate $8.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hdrtime $6.&lt;BR /&gt;&amp;nbsp; &amp;nbsp;@63 hdrqty Z8. @;&lt;/P&gt;&lt;P&gt;return;&lt;BR /&gt;End;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; idatseqd + 1;&lt;BR /&gt;&lt;BR /&gt;Input @1 irectype $ @;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;If irectype = 'T' Then Do;&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;File LSFIPCEH;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Input @2 tlrdate $char8.&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/145066"&gt;@10&lt;/a&gt;tlrtime $char4.&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/189370"&gt;@14&lt;/a&gt;tlrqty 8.;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Put @71 tlrdate $Char8.&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; &amp;nbsp; tlrtime $Char6.&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/108029"&gt;@85&lt;/a&gt;tlrqty Z8. ;&lt;/P&gt;&lt;P&gt;end;&lt;BR /&gt;Else Do;&lt;BR /&gt;put 'rec #1' ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FILE LSFIPCEO;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Input iCase_no $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iLicence_No $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iAddress_1 $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iAddress_2 $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iAddress_3 $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iAddress_4 $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iAddress_5 $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iPostcode $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iTitle $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iInitials $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iLicensee_nam $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iPhone_No $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iNINO $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i********** $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i*********** $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I********* $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i**********8 $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i********** $&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; i**********88 $;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Put irectype $char1.&lt;BR /&gt;iCase_no $Char20.&lt;BR /&gt;iLicence_No Z10.&lt;BR /&gt;iAddress_1 $Char28.&lt;BR /&gt;iAddress_2 $char28.&lt;BR /&gt;iAddress_3 $Char28.&lt;BR /&gt;iAddress_4 $Char28.&lt;BR /&gt;iAddress_5 $Char28.&lt;BR /&gt;iPostcode $Char8.&lt;BR /&gt;iTitle $Char5.&lt;BR /&gt;iInitials $Char18.&lt;BR /&gt;iLicensee_nam $Char43.&lt;BR /&gt;iPhone_No $Char30.&lt;BR /&gt;iNINO $Char10.&lt;BR /&gt;i*********** $Char1.&lt;BR /&gt;i*********** $Char8.&lt;BR /&gt;i******* $Char8.&lt;BR /&gt;i*****idence $Char1.&lt;BR /&gt;iBirth_date $char8.&lt;BR /&gt;i********* $Char5iPCE_Receipt $Char1.&lt;BR /&gt;&lt;BR /&gt;FIle SASLOG;&lt;BR /&gt;Put irectype=&lt;BR /&gt;iCase_no=&lt;BR /&gt;iLicence_No=&lt;BR /&gt;iAddress_1=&lt;BR /&gt;iAddress_2=&lt;BR /&gt;iAddress_3=&lt;BR /&gt;iAddress_4=&lt;BR /&gt;iAddress_5=&lt;BR /&gt;iPostcode =&lt;BR /&gt;iTitle=&lt;BR /&gt;iInitials=&lt;BR /&gt;iLicensee_nam=&lt;BR /&gt;iPhone_No=&lt;BR /&gt;i****=&lt;BR /&gt;i**********=&lt;BR /&gt;i********=&lt;BR /&gt;i*******t=&lt;BR /&gt;i********=&lt;BR /&gt;i********=&lt;BR /&gt;i***********=;&lt;BR /&gt;End;&lt;BR /&gt;&lt;BR /&gt;Return;&lt;BR /&gt;if irectype not = 'T' Then Do;&lt;BR /&gt;link Chktlr;&lt;BR /&gt;end;&lt;BR /&gt;ChkHdr:&lt;BR /&gt;&lt;BR /&gt;INFILE LSFIACEI End=EOFACEI Missover;&lt;BR /&gt;&lt;BR /&gt;Input @1 Hdrrtyp $char1.&lt;BR /&gt;@2 Hdrdate $char8. /* Header date */&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/145066"&gt;@10&lt;/a&gt;Hdrtime $char4. /* Header time */&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/189370"&gt;@14&lt;/a&gt;hdrqty 8.; /* Records in file */&lt;BR /&gt;&lt;BR /&gt;/* Validate record type */&lt;BR /&gt;&lt;BR /&gt;If Hdrrtyp¬= 'H' Then Do;&lt;BR /&gt;Errcode = 1;&lt;BR /&gt;Link SasAbend;&lt;BR /&gt;End;&lt;BR /&gt;Return;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Chktlr:&lt;BR /&gt;&lt;BR /&gt;INFILE LSFIPCEI End=EOFPCEI Missover;&lt;BR /&gt;&lt;BR /&gt;Input @1 Tlrrtyp $char1.&lt;BR /&gt;@2 Tlrdate $char8. /* Header date */&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/145066"&gt;@10&lt;/a&gt;Tlrtime $char4. /* Header time */&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/189370"&gt;@14&lt;/a&gt;Tlrqty 8.; /* Records in file */&lt;BR /&gt;&lt;BR /&gt;/* Validate record type */&lt;BR /&gt;&lt;BR /&gt;If Tlrrtyp¬= 'T' Then Do;&lt;BR /&gt;Errcode = 11;&lt;BR /&gt;Link SasAbend;&lt;BR /&gt;End;&lt;BR /&gt;&lt;BR /&gt;kindly explain where should i link Chktlr for trailer check&lt;BR /&gt;Thanks &amp;amp; regards&lt;BR /&gt;Rohit&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 12:16:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Validate-the-record-type/m-p/597646#M172230</guid>
      <dc:creator>rohitkrishna</dc:creator>
      <dc:date>2019-10-18T12:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Validate the record type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Validate-the-record-type/m-p/597649#M172232</link>
      <description>Please edit your post and enter the code into the running man icon window</description>
      <pubDate>Fri, 18 Oct 2019 09:10:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Validate-the-record-type/m-p/597649#M172232</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2019-10-18T09:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Validate the record type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Validate-the-record-type/m-p/597859#M172305</link>
      <description>&lt;P&gt;I'm not a big fan of "link/return" and that 's why I've proposed an alternative program structure which doesn't use "link/return".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For your code: Pay attention where the Return statements need to be; and also don't omit a return statement only because the block is at the end of your program where it hits a Run (with implicit return).&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="Capture.JPG" style="width: 415px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33302i0637321050878F96/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 312px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33303i1C22A90E23E140E8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Oct 2019 00:32:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Validate-the-record-type/m-p/597859#M172305</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-10-19T00:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: Validate the record type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Validate-the-record-type/m-p/597868#M172312</link>
      <description>&lt;P&gt;Check you program according to logic table:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Logic of program should be:&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;Rec_Type&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;Check for error&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&amp;nbsp;No error&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;_N_=1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;If rec_type NE ‘H’&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;Initialize variables, output,&lt;/P&gt;
&lt;P&gt;Check is rec_type = ‘H’&lt;/P&gt;
&lt;P&gt;Assign Phase = 0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;H&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;Phase = 1; Output header&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;New obs&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;If phase=1 and rec_type ne ‘D’&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;D&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;If phase not in (1,2)&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;Assign phase = 2;&lt;/P&gt;
&lt;P&gt;Do &lt;STRONG&gt;loop&lt;/STRONG&gt; &lt;STRONG&gt;while&lt;/STRONG&gt; rec_type = ‘D’;&lt;/P&gt;
&lt;P&gt;Output Detail;&lt;/P&gt;
&lt;P&gt;End do;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;Loop exit&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;If phase =2 and rec_type ne ‘T’&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;T&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;Output trailer;&lt;/P&gt;
&lt;P&gt;Assign phase =0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;H&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;If phase NE 0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;Assign phase=1; output header&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;D&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;T&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;End of file&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;If end-of-file and Phase NE 0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Sat, 19 Oct 2019 04:35:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Validate-the-record-type/m-p/597868#M172312</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2019-10-19T04:35:37Z</dc:date>
    </item>
  </channel>
</rss>

