<?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: how to import .obx file into SAS in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-obx-file-into-SAS/m-p/531906#M5945</link>
    <description>&lt;P&gt;Its a pipe delimited file, therefore use a datastep with infile and specify dlm="|".&amp;nbsp; As for format then look at the HL7 website for information:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blog.interfaceware.com/understanding-hl7-messages/" target="_blank"&gt;https://blog.interfaceware.com/understanding-hl7-messages/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://en.m.wikipedia.org/wiki/Health_Level_7" target="_blank"&gt;https://en.m.wikipedia.org/wiki/Health_Level_7&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Feb 2019 08:04:18 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2019-02-01T08:04:18Z</dc:date>
    <item>
      <title>how to import .obx file into SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-obx-file-into-SAS/m-p/531878#M5936</link>
      <description>&lt;P&gt;&lt;EM&gt;Here is the example format of hl7 message &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;MSH|^~\&amp;amp;||||1171400021|201811151034||ORU^R01|002186496759697690|P|2.3&lt;BR /&gt;PID||LLQBK010450|E1404514631^^^Y^EPI||98818^999 AAA||20000505|M|||^^^^^||||||||999999999|&lt;BR /&gt;PV1|1||||||^^^^^^^||||||||U||||||||||||||||||||||||&lt;BR /&gt;ORC|RE||||P&lt;BR /&gt;OBR|1|LLQBK0484340||LAB1725^CBC WITH DIFFERENTIAL^^|||201811141725||||||SCR|201811150930||^QPS^Bio-Kinetic^||||||201811151033|||F|||||||||||||||&lt;BR /&gt;NTE|1||CLINICAL INFO: SCR&lt;BR /&gt;OBX|1||1202450^WBC^^|| 6.2|K/uL|4.5-12.5||||F||||11|||&lt;BR /&gt;OBX|2||1202305^RBC^^|| 4.09|M/uL|4.60-6.20|L|||F||||11|||&lt;BR /&gt;OBX|3||1202108^HEMOGLOBIN^^|| 12.6|g/dL|14.0-18.0|L|||F||||11|||&lt;BR /&gt;OBX|4||1202105^HEMATOCRIT^^|| 37.8|%|41.0-53.0|L|||F||||11|||&lt;BR /&gt;OBX|5||1202197^MCV^^|| 92.4|fL|84.0-103.0||||F||||11|||&lt;BR /&gt;OBX|6||1202195^MCH^^|| 30.8|pg|27.0-34.0||||F||||11|||&lt;BR /&gt;OBX|7||1202196^MCHC^^|| 33.3|g/dL|30.0-35.0||||F||||11|||&lt;BR /&gt;OBX|8||1202306^RDW^^|| 12.6|%|11.0-14.5||||F||||11|||&lt;BR /&gt;OBX|9||1204184^RDW-STDEV^^|| 42.4|fL|37.0-54.0||||F||||11|||&lt;BR /&gt;OBX|10||1202276^PLATELETS^^|| 195|K/uL|140-440||||F||||11|||&lt;BR /&gt;OBX|11||1202550^MPV^^|| 12.1|fL|8.9-12.8||||F||||11|||&lt;BR /&gt;OBX|12||1202615^NEUTROPHILS^^|| 52|%|42-75||||F||||11|||&lt;BR /&gt;OBX|13||1202616^LYMPHOCYTES^^|| 36|%|24-44||||F||||11|||&lt;BR /&gt;OBX|14||1202617^MONOCYTES^^|| 10|%|2-10||||F||||11|||&lt;BR /&gt;OBX|15||1202618^EOSINOPHILS^^|| 1|%|0-7||||F||||11|||&lt;BR /&gt;OBX|16||1202619^BASOPHILS^^|| 1|%|0-1||||F||||11|||&lt;BR /&gt;OBX|17||1205095^IMMATURE GRANULOCYTES^^|| 0|%|0-2||||F||||11|||&lt;BR /&gt;OBX|18||1202578^NEUTROPHIL ABSOLUTE^^|| 3.22|K/uL|2.00-8.00||||F||||11|||&lt;BR /&gt;OBX|19||1202579^LYMPHOCYTE ABSOLUTE^^|| 2.20|K/uL|1.20-4.00||||F||||11|||&lt;BR /&gt;OBX|20||1202580^MONOCYTE ABSOLUTE^^|| 0.61|K/uL|0.10-0.60|H|||F||||11|||&lt;BR /&gt;OBX|21||1202581^EOSINOPHIL ABSOLUTE^^|| 0.06|K/uL|0.00-0.70||||F||||11|||&lt;BR /&gt;OBX|22||1202582^BASOPHILS ABSOLUTE^^|| 0.04|K/uL|0.00-0.20||||F||||11|||&lt;BR /&gt;OBX|23||1205096^IMMATURE GRANULOCYTES ABSOLUTE^^|| 0.02|K/uL|0.00-0.10||||F||||11|||&lt;BR /&gt;NTE|1||CLINICAL INFO: SCR&lt;BR /&gt;FTS|1|End Of File&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If there any procedure to import hl7/.obx file in SAS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me out!!!!&lt;/P&gt;&lt;P&gt;Thanks in advance!!!&lt;/P&gt;&lt;P&gt;Nehemiah.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 04:47:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-obx-file-into-SAS/m-p/531878#M5936</guid>
      <dc:creator>Nehemiah</dc:creator>
      <dc:date>2019-02-01T04:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to import .obx file into SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-obx-file-into-SAS/m-p/531898#M5943</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Please help us out!!!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What is your desired output?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This may get you started.&amp;nbsp; I don't see anything in your file that tells me the column names, but you could rename them in a post-processing step.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* create a file (for testing/development) ;
filename obx temp;
data _null_;
   file obx;
   input;
   put _infile_;
   datalines4;
MSH|^~\&amp;amp;||||1171400021|201811151034||ORU^R01|002186496759697690|P|2.3
PID||LLQBK010450|E1404514631^^^Y^EPI||98818^999 AAA||20000505|M|||^^^^^||||||||999999999|
PV1|1||||||^^^^^^^||||||||U||||||||||||||||||||||||
ORC|RE||||P
OBR|1|LLQBK0484340||LAB1725^CBC WITH DIFFERENTIAL^^|||201811141725||||||SCR|201811150930||^QPS^Bio-Kinetic^||||||201811151033|||F|||||||||||||||
NTE|1||CLINICAL INFO: SCR
OBX|1||1202450^WBC^^|| 6.2|K/uL|4.5-12.5||||F||||11|||
OBX|2||1202305^RBC^^|| 4.09|M/uL|4.60-6.20|L|||F||||11|||
OBX|3||1202108^HEMOGLOBIN^^|| 12.6|g/dL|14.0-18.0|L|||F||||11|||
OBX|4||1202105^HEMATOCRIT^^|| 37.8|%|41.0-53.0|L|||F||||11|||
OBX|5||1202197^MCV^^|| 92.4|fL|84.0-103.0||||F||||11|||
OBX|6||1202195^MCH^^|| 30.8|pg|27.0-34.0||||F||||11|||
OBX|7||1202196^MCHC^^|| 33.3|g/dL|30.0-35.0||||F||||11|||
OBX|8||1202306^RDW^^|| 12.6|%|11.0-14.5||||F||||11|||
OBX|9||1204184^RDW-STDEV^^|| 42.4|fL|37.0-54.0||||F||||11|||
OBX|10||1202276^PLATELETS^^|| 195|K/uL|140-440||||F||||11|||
OBX|11||1202550^MPV^^|| 12.1|fL|8.9-12.8||||F||||11|||
OBX|12||1202615^NEUTROPHILS^^|| 52|%|42-75||||F||||11|||
OBX|13||1202616^LYMPHOCYTES^^|| 36|%|24-44||||F||||11|||
OBX|14||1202617^MONOCYTES^^|| 10|%|2-10||||F||||11|||
OBX|15||1202618^EOSINOPHILS^^|| 1|%|0-7||||F||||11|||
OBX|16||1202619^BASOPHILS^^|| 1|%|0-1||||F||||11|||
OBX|17||1205095^IMMATURE GRANULOCYTES^^|| 0|%|0-2||||F||||11|||
OBX|18||1202578^NEUTROPHIL ABSOLUTE^^|| 3.22|K/uL|2.00-8.00||||F||||11|||
OBX|19||1202579^LYMPHOCYTE ABSOLUTE^^|| 2.20|K/uL|1.20-4.00||||F||||11|||
OBX|20||1202580^MONOCYTE ABSOLUTE^^|| 0.61|K/uL|0.10-0.60|H|||F||||11|||
OBX|21||1202581^EOSINOPHIL ABSOLUTE^^|| 0.06|K/uL|0.00-0.70||||F||||11|||
OBX|22||1202582^BASOPHILS ABSOLUTE^^|| 0.04|K/uL|0.00-0.20||||F||||11|||
OBX|23||1205096^IMMATURE GRANULOCYTES ABSOLUTE^^|| 0.02|K/uL|0.00-0.10||||F||||11|||
NTE|1||CLINICAL INFO: SCR
FTS|1|End Of File
;;;;
run;

* get the max column count of non-missing columns;
data _null_;
   retain column_count;
   count=0;
   infile obx end=eof;
   input;
   if _infile_ =: "OBX" then
   do i=1 to countc(_infile_,"|^")+1;
      if not missing(scan(_infile_,i,"|^")) then count+1;
      column_count=max(column_count,count);
   end;
   if eof then call symputx("column_count",column_count);
run;
%put &amp;amp;=column_count;

data foo;
   infile obx lrecl=32767;
   length var1-var&amp;amp;column_count $100;
   array vars{*} var:;
   input;
   if _infile_ =: "OBX";
   do i=1 to dim(vars);
      vars{i}=scan(_infile_,i,"|^");
   end;
   drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 06:43:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-obx-file-into-SAS/m-p/531898#M5943</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2019-02-01T06:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to import .obx file into SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-obx-file-into-SAS/m-p/531906#M5945</link>
      <description>&lt;P&gt;Its a pipe delimited file, therefore use a datastep with infile and specify dlm="|".&amp;nbsp; As for format then look at the HL7 website for information:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blog.interfaceware.com/understanding-hl7-messages/" target="_blank"&gt;https://blog.interfaceware.com/understanding-hl7-messages/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://en.m.wikipedia.org/wiki/Health_Level_7" target="_blank"&gt;https://en.m.wikipedia.org/wiki/Health_Level_7&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 08:04:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-obx-file-into-SAS/m-p/531906#M5945</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-01T08:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to import .obx file into SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-obx-file-into-SAS/m-p/533494#M6190</link>
      <description>&lt;P&gt;Hi Scott&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your solution..the given program code is really helped us a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;B.Nehemiah&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 04:30:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-obx-file-into-SAS/m-p/533494#M6190</guid>
      <dc:creator>Nehemiah</dc:creator>
      <dc:date>2019-02-07T04:30:48Z</dc:date>
    </item>
  </channel>
</rss>

