<?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: Facing error while converting s9(10)comp-3 field with PD6 and z10 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Facing-error-while-converting-s9-10-comp-3-field-with-PD6-and/m-p/934138#M367355</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/466510"&gt;@Rum&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;i specified this as in input as @1 rec_id PD6 and at output as Z10. Both source and dat file conversion doing on mainframe not out of it that&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So you seem to be saying you have program something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile myfile ;
  input @1 rec_id pd6.;
  format rec_id Z10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So take a look at what is actually in the 6 bytes at the start of the record.&amp;nbsp; You could use the LIST statement to have SAS dump the data to the log.&amp;nbsp; You could read the value into a character string and print it with the $HEX format to see what it has.&amp;nbsp; So perhaps something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile myfile ;
  input @1 rec_id_hex $char6. @1 rec_id pd6.;
  format rec_id Z10. rec_id_hex $hex.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Once you have some of the example values share them with us and we can help you check if they really are in PD format or not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example here is little program you try running to see what PD values should look like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  do integer=1 to 4000 by 500;
    pd = put(integer,pd6.);
    s370fpd = put(integer,s370fpd6.);
    output;
  end;
  format pd s370fpd $hex.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results when run on Windows.&lt;/P&gt;
&lt;PRE&gt;Obs    integer         pd           s370fpd

 1          1     000000000001    00000000001C
 2        501     000000000501    00000000501C
 3       1001     000000001001    00000001001C
 4       1501     000000001501    00000001501C
 5       2001     000000002001    00000002001C
 6       2501     000000002501    00000002501C
 7       3001     000000003001    00000003001C
 8       3501     000000003501    00000003501C

&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Notice how the S370FPD format has that hex digit C in the last nibble of the last byte while the PD format on Windows does not.&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jun 2024 18:41:38 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2024-06-28T18:41:38Z</dc:date>
    <item>
      <title>Facing error while converting s9(10)comp-3 field with PD6 and z10</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Facing-error-while-converting-s9-10-comp-3-field-with-PD6-and/m-p/933919#M367286</link>
      <description>Hi anyone,&lt;BR /&gt;&lt;BR /&gt;I'm working on data extraction part in mainframe using sas scripts.one of my column have datatype as S9(10) comp-3 to read this I used PD6 and Z10. But, it produced zeros for me.. pls anyone suggest me best idea how to read this</description>
      <pubDate>Thu, 27 Jun 2024 16:19:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Facing-error-while-converting-s9-10-comp-3-field-with-PD6-and/m-p/933919#M367286</guid>
      <dc:creator>Rum</dc:creator>
      <dc:date>2024-06-27T16:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Facing error while converting s9(10)comp-3 field with PD6 and z10</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Facing-error-while-converting-s9-10-comp-3-field-with-PD6-and/m-p/933923#M367288</link>
      <description>&lt;P&gt;What does your log show for this step? Best is to copy the text from the log with any notes, warning or error messages and then on the forum open a text box using the &amp;lt;/&amp;gt; icon above the message window and paste all the text. The text box helps maintain formatting of any diagnostic messages that SAS provides.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 16:36:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Facing-error-while-converting-s9-10-comp-3-field-with-PD6-and/m-p/933923#M367288</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-06-27T16:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Facing error while converting s9(10)comp-3 field with PD6 and z10</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Facing-error-while-converting-s9-10-comp-3-field-with-PD6-and/m-p/934018#M367330</link>
      <description>There is no error message in log ..after converting source file to dat using sas Im getting zeros on this column..</description>
      <pubDate>Fri, 28 Jun 2024 09:38:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Facing-error-while-converting-s9-10-comp-3-field-with-PD6-and/m-p/934018#M367330</guid>
      <dc:creator>Rum</dc:creator>
      <dc:date>2024-06-28T09:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Facing error while converting s9(10)comp-3 field with PD6 and z10</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Facing-error-while-converting-s9-10-comp-3-field-with-PD6-and/m-p/934045#M367337</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/466510"&gt;@Rum&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;There is no error message in log ..after converting source file to dat using sas Im getting zeros on this column..&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Show the code. Show the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are reading in the value from some file then try reading the set of bytes using $CHAR informat and then print them using $HEX to see what values you actually have in the file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then try convert those values into what you want.&amp;nbsp; Read the documentation on the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n0xnvrbp96w34un1j7fgbfqgz4x5.htm" target="_self"&gt;PD informat&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Notice the warning message:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="xisDoc-noteGenText"&gt;Note:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Different operating environments store packed decimal values in different ways. However, PD&lt;/SPAN&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;w&lt;/EM&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;d&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;reads packed decimal values with consistent results if the values are created in the same type of operating environment that you use to run SAS.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If the text file was made on an IBM mainframe and you are reading it on some other platform then you might need to use the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n1f6ogvbxp663tn13icvl1197roj.htm" target="_self"&gt;S370FPD informat&lt;/A&gt; instead.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 12:55:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Facing-error-while-converting-s9-10-comp-3-field-with-PD6-and/m-p/934045#M367337</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-06-28T12:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Facing error while converting s9(10)comp-3 field with PD6 and z10</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Facing-error-while-converting-s9-10-comp-3-field-with-PD6-and/m-p/934112#M367351</link>
      <description />
      <pubDate>Fri, 28 Jun 2024 16:01:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Facing-error-while-converting-s9-10-comp-3-field-with-PD6-and/m-p/934112#M367351</guid>
      <dc:creator>Rum</dc:creator>
      <dc:date>2024-06-28T16:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Facing error while converting s9(10)comp-3 field with PD6 and z10</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Facing-error-while-converting-s9-10-comp-3-field-with-PD6-and/m-p/934113#M367352</link>
      <description>i specified this as in input as @1 rec_id PD6 and at output as Z10. Both source and dat file conversion doing on mainframe not out of it that</description>
      <pubDate>Fri, 28 Jun 2024 16:04:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Facing-error-while-converting-s9-10-comp-3-field-with-PD6-and/m-p/934113#M367352</guid>
      <dc:creator>Rum</dc:creator>
      <dc:date>2024-06-28T16:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Facing error while converting s9(10)comp-3 field with PD6 and z10</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Facing-error-while-converting-s9-10-comp-3-field-with-PD6-and/m-p/934138#M367355</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/466510"&gt;@Rum&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;i specified this as in input as @1 rec_id PD6 and at output as Z10. Both source and dat file conversion doing on mainframe not out of it that&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So you seem to be saying you have program something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile myfile ;
  input @1 rec_id pd6.;
  format rec_id Z10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So take a look at what is actually in the 6 bytes at the start of the record.&amp;nbsp; You could use the LIST statement to have SAS dump the data to the log.&amp;nbsp; You could read the value into a character string and print it with the $HEX format to see what it has.&amp;nbsp; So perhaps something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile myfile ;
  input @1 rec_id_hex $char6. @1 rec_id pd6.;
  format rec_id Z10. rec_id_hex $hex.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Once you have some of the example values share them with us and we can help you check if they really are in PD format or not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example here is little program you try running to see what PD values should look like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  do integer=1 to 4000 by 500;
    pd = put(integer,pd6.);
    s370fpd = put(integer,s370fpd6.);
    output;
  end;
  format pd s370fpd $hex.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results when run on Windows.&lt;/P&gt;
&lt;PRE&gt;Obs    integer         pd           s370fpd

 1          1     000000000001    00000000001C
 2        501     000000000501    00000000501C
 3       1001     000000001001    00000001001C
 4       1501     000000001501    00000001501C
 5       2001     000000002001    00000002001C
 6       2501     000000002501    00000002501C
 7       3001     000000003001    00000003001C
 8       3501     000000003501    00000003501C

&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Notice how the S370FPD format has that hex digit C in the last nibble of the last byte while the PD format on Windows does not.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 18:41:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Facing-error-while-converting-s9-10-comp-3-field-with-PD6-and/m-p/934138#M367355</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-06-28T18:41:38Z</dc:date>
    </item>
  </channel>
</rss>

