<?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 Scoring from HPSPLIT model -  I get Error: Width specified for format is invalid. in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Scoring-from-HPSPLIT-model-I-get-Error-Width-specified-for/m-p/429108#M6573</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a model using the HPSPLIT proc. The model was successfully saved into the file '&lt;SPAN&gt;HPSPLIT_model.sas'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, I can't use it to score new data! I'm getting format errors, which are quite cryptic to me as a new SAS user. I added&amp;nbsp;1 example of such error below, but I'm getting many of them.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any idea what the issue is, and what the solution could be?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data SCORES.SCORED_DATA;&lt;BR /&gt;set SCORING.DATA_TO_SCOREend=eof;&lt;BR /&gt;%include "HPSPLIT_model.sas";&lt;BR /&gt;Prediction=P_target1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;14950 +_RT_68_16 = ' ';&lt;BR /&gt;14951 +DROP _RT_68_16;&lt;BR /&gt;14952 +_RT_68_16 = PUT(HUG_STS, $16.);&lt;BR /&gt;14953 +%DMNORMIP(_RT_68_16);&lt;BR /&gt;14954 +LENGTH _RT_75_50 $50;&lt;BR /&gt;WARNING: Variable MODEL_SPEC has already been defined as numeric.&lt;BR /&gt;14955 +_RT_75_50 = ' ';&lt;BR /&gt;14956 +DROP _RT_75_50;&lt;BR /&gt;14957 +_RT_75_50 = PUT(MODEL_SPEC, $50.);&lt;BR /&gt;----&lt;BR /&gt;29&lt;BR /&gt;ERROR 29-185: Width specified for format is invalid.&lt;/P&gt;</description>
    <pubDate>Fri, 19 Jan 2018 13:37:08 GMT</pubDate>
    <dc:creator>Charlot</dc:creator>
    <dc:date>2018-01-19T13:37:08Z</dc:date>
    <item>
      <title>Scoring from HPSPLIT model -  I get Error: Width specified for format is invalid.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Scoring-from-HPSPLIT-model-I-get-Error-Width-specified-for/m-p/429108#M6573</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a model using the HPSPLIT proc. The model was successfully saved into the file '&lt;SPAN&gt;HPSPLIT_model.sas'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, I can't use it to score new data! I'm getting format errors, which are quite cryptic to me as a new SAS user. I added&amp;nbsp;1 example of such error below, but I'm getting many of them.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any idea what the issue is, and what the solution could be?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data SCORES.SCORED_DATA;&lt;BR /&gt;set SCORING.DATA_TO_SCOREend=eof;&lt;BR /&gt;%include "HPSPLIT_model.sas";&lt;BR /&gt;Prediction=P_target1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;14950 +_RT_68_16 = ' ';&lt;BR /&gt;14951 +DROP _RT_68_16;&lt;BR /&gt;14952 +_RT_68_16 = PUT(HUG_STS, $16.);&lt;BR /&gt;14953 +%DMNORMIP(_RT_68_16);&lt;BR /&gt;14954 +LENGTH _RT_75_50 $50;&lt;BR /&gt;WARNING: Variable MODEL_SPEC has already been defined as numeric.&lt;BR /&gt;14955 +_RT_75_50 = ' ';&lt;BR /&gt;14956 +DROP _RT_75_50;&lt;BR /&gt;14957 +_RT_75_50 = PUT(MODEL_SPEC, $50.);&lt;BR /&gt;----&lt;BR /&gt;29&lt;BR /&gt;ERROR 29-185: Width specified for format is invalid.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 13:37:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Scoring-from-HPSPLIT-model-I-get-Error-Width-specified-for/m-p/429108#M6573</guid>
      <dc:creator>Charlot</dc:creator>
      <dc:date>2018-01-19T13:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Scoring from HPSPLIT model -  I get Error: Width specified for format is invalid.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Scoring-from-HPSPLIT-model-I-get-Error-Width-specified-for/m-p/429111#M6574</link>
      <description>&lt;P&gt;My guess is that MODEL_SPEC was a character variable in your training data that was used to create the model and score code, and it is numeric in the data you are scoring.&amp;nbsp; It would need to be the same type in both data sets.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 13:45:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Scoring-from-HPSPLIT-model-I-get-Error-Width-specified-for/m-p/429111#M6574</guid>
      <dc:creator>WendyCzika</dc:creator>
      <dc:date>2018-01-19T13:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Scoring from HPSPLIT model -  I get Error: Width specified for format is invalid.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Scoring-from-HPSPLIT-model-I-get-Error-Width-specified-for/m-p/429138#M6575</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Wendy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, both the training/testing datasets are created from the exact same code (except for what I'm filtering on.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; data SCORING.data_test;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set SOURCE.MyData (WHERE=(data_role='Test'));&lt;BR /&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; data Training.data_train;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set SOURCE.MyData (WHERE=(data_role='Train'));&lt;BR /&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll try to see if anything else could cause the difference in the data types.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 14:33:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Scoring-from-HPSPLIT-model-I-get-Error-Width-specified-for/m-p/429138#M6575</guid>
      <dc:creator>Charlot</dc:creator>
      <dc:date>2018-01-19T14:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Scoring from HPSPLIT model -  I get Error: Width specified for format is invalid.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Scoring-from-HPSPLIT-model-I-get-Error-Width-specified-for/m-p/429152#M6577</link>
      <description>&lt;P&gt;It's the data you are scoring that I'm wondering if it has differences:&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;SCORING.DATA_TO_SCORE&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 15:07:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Scoring-from-HPSPLIT-model-I-get-Error-Width-specified-for/m-p/429152#M6577</guid>
      <dc:creator>WendyCzika</dc:creator>
      <dc:date>2018-01-19T15:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Scoring from HPSPLIT model -  I get Error: Width specified for format is invalid.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Scoring-from-HPSPLIT-model-I-get-Error-Width-specified-for/m-p/429156#M6578</link>
      <description>&lt;P&gt;Sorry Wendy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm modifying the table/variable names to ensure confidentiality...and I wasn't consistent in my 'modified' names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I should have written:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; data SCORING.DATA_TO_SCORE;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set SOURCE.MyData (WHERE=(data_role='Test'));&lt;BR /&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; data Training.data_train;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set SOURCE.MyData (WHERE=(data_role='Train'));&lt;BR /&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, I removed all the code in the .sas Decision Tree model files that appeared between these 2 comments:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;******&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TEMPORARY VARIABLES FOR FORMATTED VALUES&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ******;&lt;BR /&gt;&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; ASSIGN OBSERVATION TO NODE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ******;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far it seems to work. However, My model is actually built from 200+ 'sub-models', so I have 200+ files to edit. I guess it can be done with a UNIX command.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 15:17:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Scoring-from-HPSPLIT-model-I-get-Error-Width-specified-for/m-p/429156#M6578</guid>
      <dc:creator>Charlot</dc:creator>
      <dc:date>2018-01-19T15:17:18Z</dc:date>
    </item>
  </channel>
</rss>

