<?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 Hex input to text output - z/OS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Hex-input-to-text-output-z-OS/m-p/491670#M129005</link>
    <description>&lt;P&gt;I'm fairly new to SAS but not z/OS and other languages on that platform.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm reading a dataset that has data stored in as a hex value.&amp;nbsp; In my example, the value stored in one byte is x'76'.&amp;nbsp; I need to convert this to the decimal equivalent of 118 and then add 1900 (it's a year).&amp;nbsp; I've searched many samples and found PUT or INPUT statements that seem like they should work but none have so far.&amp;nbsp; If someone can provide a sample statement to do this, I'd greatly appreciate it.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 31 Aug 2018 15:29:02 GMT</pubDate>
    <dc:creator>zossysprog</dc:creator>
    <dc:date>2018-08-31T15:29:02Z</dc:date>
    <item>
      <title>Hex input to text output - z/OS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hex-input-to-text-output-z-OS/m-p/491670#M129005</link>
      <description>&lt;P&gt;I'm fairly new to SAS but not z/OS and other languages on that platform.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm reading a dataset that has data stored in as a hex value.&amp;nbsp; In my example, the value stored in one byte is x'76'.&amp;nbsp; I need to convert this to the decimal equivalent of 118 and then add 1900 (it's a year).&amp;nbsp; I've searched many samples and found PUT or INPUT statements that seem like they should work but none have so far.&amp;nbsp; If someone can provide a sample statement to do this, I'd greatly appreciate it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 15:29:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hex-input-to-text-output-z-OS/m-p/491670#M129005</guid>
      <dc:creator>zossysprog</dc:creator>
      <dc:date>2018-08-31T15:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: Hex input to text output - z/OS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hex-input-to-text-output-z-OS/m-p/491675#M129008</link>
      <description>&lt;P&gt;Since you are use mainframe I will assume that by "dataset" you actually mean that you have a raw file that you want to read into a SAS dataset.&amp;nbsp; To read binary data use the PIB informat.&lt;/P&gt;
&lt;P&gt;Let's make a sample file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename test temp;
data _null_;
  file test recfm=f lrecl=10;
  put 'ABCDEFGHI' '76'x ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And then read it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  infile test recfm=f lrecl=10;
  input name $9. yr pib1.;
  list;
  yr=yr + 1900;
  put name= yr= ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;46    data want ;
47      infile test recfm=f lrecl=10;
48      input name $9. yr pib1.;
49      list;
50      yr=yr + 1900;
51      put name= yr= ;
52    run;

NOTE: The infile TEST is:

      Filename=...
      RECFM=F,LRECL=10,File Size (bytes)=10,
      Last Modified=31Aug2018:11:37:12,
      Create Time=31Aug2018:11:37:12

name=ABCDEFGHI yr=2018
RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+--
1         ABCDEFGHIv
NOTE: 1 record was read from the infile TEST.
NOTE: The data set WORK.WANT has 1 observations and 2 variables.
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 15:40:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hex-input-to-text-output-z-OS/m-p/491675#M129008</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-08-31T15:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Hex input to text output - z/OS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hex-input-to-text-output-z-OS/m-p/491677#M129009</link>
      <description>&lt;P&gt;Thank you.&amp;nbsp; This is exactly what I needed.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 15:48:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hex-input-to-text-output-z-OS/m-p/491677#M129009</guid>
      <dc:creator>zossysprog</dc:creator>
      <dc:date>2018-08-31T15:48:15Z</dc:date>
    </item>
  </channel>
</rss>

