BookmarkSubscribeRSS Feed
alexist
Obsidian | Level 7

I am getting the "invalid numeric data" note multiple times and I am unsure why. I have included the code and the notes below. I see that the name of cereal in the note, but I do not know where it is specified as a numeric value. Thank you for any help provided!

 

Code: 

Filename yourdata '/folders/myfolders/sasuser.v94/excel/Diet_data.csv';
proc import datafile=yourdata
  out=work.yourdata
  dbms=csv
  replace;
run;





/*

  The following files are contained within the archive that 

  contained this analysis program.  Once extracted from the archive, 

  these files should be located in the same folder/directory as 

  the analysis program.

*/  



  libname ntile xlsx '/folders/myfolders/sasuser.v94/excel/calib.DSQ.cereal.ntile.xlsx'; 

  libname psize xlsx '/folders/myfolders/sasuser.v94/excel/calib.portion.size.xlsx';

  libname rcoeff xlsx '/folders/myfolders/sasuser.v94/excel/calib.equation.coeff.xlsx'; 





proc format;  

  value gender 1='male'

               2='female';



run;



data dtq;

  set yourdata;



/*this program uses variables names:

    DSQ_xx1

    DSQ_xx2

    DSQ_010, DSQ_030, etc



 ***PLEASE NOTE SPECIAL CEREAL RECODING IS REQUIRED BEFORE RUNNING THIS CODE****



 DSQ_020 and DSQ_xx3 MUST be converted to an 8 digit foodcode by the user



 The current variables (DSQ_020 and DSQ_xx3) are character variables that represent

 assorted cereals.  Using the 'calib.DSQ.cereal.ntile.xlsx' file, the user

 must create new variables, which will be called:



   food_code_1 and

   food_code_2



 and contain an eight digit FNDDS foodcode which represents the particular cereal

 that was reported.  If only one cereal is reported,  food_code_2 should remain blank.



*/



/*in this data step, create variables: 

  Required names include: ageinyr (age in years) gender (1=male 2=female)  

  and the food ffq - each food has two variables, times and units 

*/



  ageinyr=DSQ_xx1;

  if DSQ_xx2='1' then gender=1;			

    else if DSQ_xx2='2' then gender=2;



  cereal1fc=food_code_1;

  cereal2fc=food_code_2;



/*create numcer to represent the number of cereals provided;

*/



  if cereal1fc= . and cereal2fc= . then numcer=0;

    else if cereal1fc > 0 and cereal2fc > 0 then numcer=2;

    else if cereal1fc > 0 then numcer=1;





/*converting responses into times per day for food variables of interest;

*/



 %macro foodrange (in,out,maxv);

 if &in='A' then &out=0;

   else if &in='B' then &out=0.033;

   else if &in='C' then &out=0.083;

   else if &in='D' then &out=0.143;

   else if &in='E' then &out=0.286;

   else if &in='F' then &out=0.5;

   else if &in='G' then &out=0.786;

   else if &in='H' then &out=1;

   else if &in='I' then &out=2;

    *top code outliers;

   if &out > &maxv then &out=&maxv;    

%mend foodrange;



%macro bevrange (in,out,maxv);

 if &in='A' then &out=0;

   else if &in='B' then &out=0.033;

   else if &in='C' then &out=0.083;

   else if &in='D' then &out=0.143;

   else if &in='E' then &out=0.286;

   else if &in='F' then &out=0.5;

   else if &in='G' then &out=0.786;

   else if &in='H' then &out=1;

   else if &in='I' then &out=2.5;

   else if &in='J' then &out=4.5;

   else if &in='K' then &out=6;

    *top code outliers;

   if &out > &maxv then &out=&maxv;  

%mend bevrange;



  %foodrange(dsq_010,hccerxpd,7);

  %bevrange(dsq_030,milkxpd,10);

  %bevrange(dsq_040,sodaxpd,8);

  %bevrange(dsq_050,frtjcxpd,8);

  %bevrange(dsq_060,swtctxpd,10);

  %bevrange(dsq_070,energyxpd,7);

  %foodrange(dsq_080,fruitxpd,8);

  %foodrange(dsq_090,saladxpd,5);

  %foodrange(dsq_100,frfryxpd,5);

  %foodrange(dsq_110,othpotxpd,3);

  %foodrange(dsq_120,beanxpd,4);

  %foodrange(dsq_130,othvegxpd,5);

  %foodrange(dsq_140,pizzaxpd,2);

  %foodrange(dsq_150,salsaxpd,3);

  %foodrange(dsq_160,tomscxpd,2);

  %foodrange(dsq_190,cheesexpd,6);

  %foodrange(dsq_200,whgbrdxpd,6);

  %foodrange(dsq_210,brricexpd,4);

  %foodrange(dsq_220,candyxpd,8);

  %foodrange(dsq_230,donutxpd,5);

  %foodrange(dsq_240,cakexpd,7);

  %foodrange(dsq_250,icecrmxpd,5);

  %foodrange(dsq_260,popcornxpd,3);



  label hccerxpd='number of times per day eat hot or cold cereal'
        milkxpd='number of times per day drink milk'
	sodaxpd='number of times per day drink soda'
	frtjcxpd='number of times per day drink fruit juice'
	swtctxpd='number of times per day drink sweet coffee/tea'
	energyxpd='number of times per day drink fruit/sports/energy drink'
	fruitxpd='number of times per day eat fruit'
	saladxpd='number of times per day eat salad'
	frfryxpd='number of times per day eat fried potatoes'
	othpotxpd='number of times per day eat other potatoes'
	beanxpd='number of times per day eat beans'
	othvegxpd='number of times per day eat other vegetables'
	pizzaxpd='number of times per day eat pizza'
	salsaxpd='number of times per day eat salsa'
	tomscxpd='number of times per day eat tomtato sauce'
	cheesexpd='number of times per day eat cheese'
	whgbrdxpd='number of times per day eat whole grain bread'
	brricexpd='number of times per day eat cooked whole grain (brown rice)'
	candyxpd='number of times per day eat candy'
	donutxpd='number of times per day eat pastries'
	cakexpd='number of times per day eat cookies/cake'
	icecrmxpd='number of times per day eat ice cream'
	popcornxpd='number of times per day eat pop corn';

   if (2 <= ageinyr <= 3) then bcage=1;
    else if (4 <= ageinyr <= 5) then bcage=2;
    else if (6 <= ageinyr <= 7) then bcage=3;
    else if (8 <= ageinyr <= 9) then bcage=4;
    else if (10 <= ageinyr <= 11) then bcage=5;
    else if (12 <= ageinyr <= 13) then bcage=6;
    else if (14 <= ageinyr <= 15) then bcage=7;
    else if (16 <= ageinyr <= 17) then bcage=8;
    else if (18 <= ageinyr <= 25) then bcage=9;
    else if (26 <= ageinyr <= 35) then bcage=10;
    else if (36 <= ageinyr <= 45) then bcage=11;
    else if (46 <= ageinyr <= 60) then bcage=12;
    else if (61 <= ageinyr <= 69) then bcage=13;
    else if (70 <= ageinyr <= 99) then bcage=14;

    *make age dummy variables ****;

    if (2 <= ageinyr <= 11) then kidgrp=1;
      else kidgrp=0;
    if (12 <= ageinyr <= 17) then teengrp=1;
      else teengrp=0;

run 

 

 

 

 

Notes: 

 491        run;
 
 NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
       321:6    321:23   323:13   323:31   325:13   
 NOTE: Invalid numeric data, cereal1fc='Steel cut oats' , at line 321 column 6.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=C food_code_1=Steel cut oats food_code_2=  DSQ_030=F DSQ_xx4=A DSQ_xx4os=  DSQ_040=C
 DSQ_050=E DSQ_060=A DSQ_070=A DSQ_080=H DSQ_090=H DSQ_100=G DSQ_110=D DSQ_120=D DSQ_210=E DSQ_130=H DSQ_150=B DSQ_140=B DSQ_160=E
 DSQ_190=F DSQ_170=E DSQ_180=C DSQ_200=C DSQ_220=D DSQ_230=A DSQ_240=C DSQ_250=E DSQ_260=A ageinyr=99 gender=.
 cereal1fc=Steel cut oats cereal2fc=  numcer=0 hccerxpd=0.083 milkxpd=0.5 sodaxpd=0.083 frtjcxpd=0.286 swtctxpd=0 energyxpd=0
 fruitxpd=1 saladxpd=1 frfryxpd=0.786 othpotxpd=0.143 beanxpd=0.143 othvegxpd=1 pizzaxpd=0.033 salsaxpd=0.033 tomscxpd=0.286
 cheesexpd=0.5 whgbrdxpd=0.083 brricexpd=0.286 candyxpd=0.143 donutxpd=0 cakexpd=0.083 icecrmxpd=0.286 popcornxpd=0 bcage=10 kidgrp=0
 teengrp=0 _ERROR_=1 _N_=1
 NOTE: Invalid numeric data, cereal1fc='chex' , at line 321 column 6.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=E food_code_1=chex food_code_2=  DSQ_030=E DSQ_xx4=B DSQ_xx4os=  DSQ_040=B DSQ_050=A
 DSQ_060=I DSQ_070=C DSQ_080=H DSQ_090=G DSQ_100=E DSQ_110=F DSQ_120=C DSQ_210=A DSQ_130=F DSQ_150=C DSQ_140=B DSQ_160=C DSQ_190=C
 DSQ_170=E DSQ_180=C DSQ_200=B DSQ_220=F DSQ_230=B DSQ_240=D DSQ_250=E DSQ_260=D ageinyr=99 gender=. cereal1fc=chex cereal2fc= 
 numcer=0 hccerxpd=0.286 milkxpd=0.286 sodaxpd=0.033 frtjcxpd=0 swtctxpd=2.5 energyxpd=0.083 fruitxpd=1 saladxpd=0.786 frfryxpd=0.286
 othpotxpd=0.5 beanxpd=0.083 othvegxpd=0.5 pizzaxpd=0.033 salsaxpd=0.083 tomscxpd=0.083 cheesexpd=0.083 whgbrdxpd=0.033 brricexpd=0
 candyxpd=0.5 donutxpd=0.033 cakexpd=0.143 icecrmxpd=0.286 popcornxpd=0.143 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=2
 NOTE: Invalid numeric data, cereal1fc='raisin bran' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='special k red berries' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=F food_code_1=raisin bran food_code_2=special k red berries DSQ_030=F DSQ_xx4=B DSQ_xx4os= 
 DSQ_040=A DSQ_050=C DSQ_060=I DSQ_070=B DSQ_080=I DSQ_090=E DSQ_100=D DSQ_110=C DSQ_120=B DSQ_210=C DSQ_130=G DSQ_150=C DSQ_140=C
 DSQ_160=C DSQ_190=E DSQ_170=E DSQ_180=D DSQ_200=H DSQ_220=D DSQ_230=D DSQ_240=E DSQ_250=D DSQ_260=A ageinyr=99 gender=.
 cereal1fc=raisin bran cereal2fc=special k red berries numcer=0 hccerxpd=0.5 milkxpd=0.5 sodaxpd=0 frtjcxpd=0.083 swtctxpd=2.5
 energyxpd=0.033 fruitxpd=2 saladxpd=0.286 frfryxpd=0.143 othpotxpd=0.083 beanxpd=0.033 othvegxpd=0.786 pizzaxpd=0.083 salsaxpd=0.083
 tomscxpd=0.083 cheesexpd=0.286 whgbrdxpd=1 brricexpd=0.083 candyxpd=0.143 donutxpd=0.143 cakexpd=0.286 icecrmxpd=0.143 popcornxpd=0
 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=4
 NOTE: Invalid numeric data, cereal1fc='cheerios' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='none' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=E food_code_1=cheerios food_code_2=none DSQ_030=D DSQ_xx4=A DSQ_xx4os=  DSQ_040=F DSQ_050=D
 DSQ_060=E DSQ_070=A DSQ_080=H DSQ_090=I DSQ_100=C DSQ_110=D DSQ_120=C DSQ_210=F DSQ_130=I DSQ_150=E DSQ_140=C DSQ_160=D DSQ_190=G
 DSQ_170=E DSQ_180=C DSQ_200=F DSQ_220=H DSQ_230=B DSQ_240=B DSQ_250=D DSQ_260=D ageinyr=99 gender=. cereal1fc=cheerios
 cereal2fc=none numcer=0 hccerxpd=0.286 milkxpd=0.143 sodaxpd=0.5 frtjcxpd=0.143 swtctxpd=0.286 energyxpd=0 fruitxpd=1 saladxpd=2
 frfryxpd=0.083 othpotxpd=0.143 beanxpd=0.083 othvegxpd=2 pizzaxpd=0.083 salsaxpd=0.286 tomscxpd=0.143 cheesexpd=0.786 whgbrdxpd=0.5
 brricexpd=0.5 candyxpd=1 donutxpd=0.033 cakexpd=0.033 icecrmxpd=0.143 popcornxpd=0.143 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=5
 NOTE: Invalid numeric data, cereal1fc='steel cut oats' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='none' , at line 321 column 23.
 DSQ_xx1=26 DSQ_xx2=b DSQ_010=C food_code_1=steel cut oats food_code_2=none DSQ_030=A DSQ_xx4=  DSQ_xx4os=  DSQ_040=B
 DSQ_050=C DSQ_060=A DSQ_070=A DSQ_080=E DSQ_090=H DSQ_100=C DSQ_110=B DSQ_120=C DSQ_210=D DSQ_130=H DSQ_150=F DSQ_140=C DSQ_160=C
 DSQ_190=C DSQ_170=A DSQ_180=C DSQ_200=B DSQ_220=E DSQ_230=A DSQ_240=C DSQ_250=A DSQ_260=D ageinyr=99 gender=.
 cereal1fc=steel cut oats cereal2fc=none numcer=0 hccerxpd=0.083 milkxpd=0 sodaxpd=0.033 frtjcxpd=0.083 swtctxpd=0 energyxpd=0
 fruitxpd=0.286 saladxpd=1 frfryxpd=0.083 othpotxpd=0.033 beanxpd=0.083 othvegxpd=1 pizzaxpd=0.083 salsaxpd=0.5 tomscxpd=0.083
 cheesexpd=0.083 whgbrdxpd=0.033 brricexpd=0.143 candyxpd=0.286 donutxpd=0 cakexpd=0.083 icecrmxpd=0 popcornxpd=0.143 bcage=10
 kidgrp=0 teengrp=0 _ERROR_=1 _N_=6
 NOTE: Invalid numeric data, cereal1fc='oatmeal' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='grits' , at line 321 column 23. DSQ_xx1=26 DSQ_xx2=b DSQ_010=C food_code_1=oatmeal food_code_2=grits DSQ_030=A DSQ_xx4=  DSQ_xx4os=  DSQ_040=F DSQ_050=C
 DSQ_060=C DSQ_070=E DSQ_080=D DSQ_090=C DSQ_100=E DSQ_110=D DSQ_120=C DSQ_210=A DSQ_130=E DSQ_150=A DSQ_140=C DSQ_160=D DSQ_190=E
 DSQ_170=E DSQ_180=D DSQ_200=C DSQ_220=C DSQ_230=D DSQ_240=C DSQ_250=D DSQ_260=B ageinyr=99 gender=. cereal1fc=oatmeal
 cereal2fc=grits numcer=0 hccerxpd=0.083 milkxpd=0 sodaxpd=0.5 frtjcxpd=0.083 swtctxpd=0.083 energyxpd=0.286 fruitxpd=0.143
 saladxpd=0.083 frfryxpd=0.286 othpotxpd=0.143 beanxpd=0.083 othvegxpd=0.286 pizzaxpd=0.083 salsaxpd=0 tomscxpd=0.143 cheesexpd=0.286
 whgbrdxpd=0.083 brricexpd=0 candyxpd=0.083 donutxpd=0.143 cakexpd=0.083 icecrmxpd=0.143 popcornxpd=0.033 bcage=10 kidgrp=0 teengrp=0
 _ERROR_=1 _N_=7
 NOTE: Invalid numeric data, cereal1fc='coco crispies' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='n/a' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=C food_code_1=coco crispies food_code_2=n/a DSQ_030=D DSQ_xx4=C DSQ_xx4os=  DSQ_040=E
 DSQ_050=C DSQ_060=C DSQ_070=D DSQ_080=B DSQ_090=C DSQ_100=C DSQ_110=B DSQ_120=D DSQ_210=A DSQ_130=C DSQ_150=C DSQ_140=C DSQ_160=B
 DSQ_190=E DSQ_170=D DSQ_180=E DSQ_200=E DSQ_220=C DSQ_230=A DSQ_240=B DSQ_250=A DSQ_260=B ageinyr=99 gender=.
 cereal1fc=coco crispies cereal2fc=n/a numcer=0 hccerxpd=0.083 milkxpd=0.143 sodaxpd=0.286 frtjcxpd=0.083 swtctxpd=0.083
 energyxpd=0.143 fruitxpd=0.033 saladxpd=0.083 frfryxpd=0.083 othpotxpd=0.033 beanxpd=0.143 othvegxpd=0.083 pizzaxpd=0.083
 salsaxpd=0.083 tomscxpd=0.033 cheesexpd=0.286 whgbrdxpd=0.286 brricexpd=0 candyxpd=0.083 donutxpd=0 cakexpd=0.033 icecrmxpd=0
 popcornxpd=0.033 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=8
 NOTE: Invalid numeric data, cereal1fc='Reese's Puffs' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='NONE' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=B food_code_1=Reese's Puffs food_code_2=NONE DSQ_030=A DSQ_xx4=  DSQ_xx4os=  DSQ_040=C
 DSQ_050=A DSQ_060=A DSQ_070=A DSQ_080=E DSQ_090=E DSQ_100=D DSQ_110=D DSQ_120=B DSQ_210=A DSQ_130=H DSQ_150=F DSQ_140=D DSQ_160=D
 DSQ_190=H DSQ_170=D DSQ_180=C DSQ_200=E DSQ_220=D DSQ_230=D DSQ_240=D DSQ_250=D DSQ_260=B ageinyr=99 gender=.
 cereal1fc=Reese's Puffs cereal2fc=NONE numcer=0 hccerxpd=0.033 milkxpd=0 sodaxpd=0.083 frtjcxpd=0 swtctxpd=0 energyxpd=0
 fruitxpd=0.286 saladxpd=0.286 frfryxpd=0.143 othpotxpd=0.143 beanxpd=0.033 othvegxpd=1 pizzaxpd=0.143 salsaxpd=0.5 tomscxpd=0.143
 cheesexpd=1 whgbrdxpd=0.286 brricexpd=0 candyxpd=0.143 donutxpd=0.143 cakexpd=0.143 icecrmxpd=0.143 popcornxpd=0.033 bcage=10
 kidgrp=0 teengrp=0 _ERROR_=1 _N_=12
 NOTE: Invalid numeric data, cereal1fc='Cheerios' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='None' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=F food_code_1=Cheerios food_code_2=None DSQ_030=F DSQ_xx4=B DSQ_xx4os=  DSQ_040=C DSQ_050=E
 DSQ_060=F DSQ_070=A DSQ_080=C DSQ_090=E DSQ_100=C DSQ_110=C DSQ_120=A DSQ_210=B DSQ_130=E DSQ_150=A DSQ_140=B DSQ_160=C DSQ_190=F
 DSQ_170=E DSQ_180=C DSQ_200=E DSQ_220=D DSQ_230=D DSQ_240=A DSQ_250=B DSQ_260=B ageinyr=99 gender=. cereal1fc=Cheerios
 cereal2fc=None numcer=0 hccerxpd=0.5 milkxpd=0.5 sodaxpd=0.083 frtjcxpd=0.286 swtctxpd=0.5 energyxpd=0 fruitxpd=0.083 saladxpd=0.286
 frfryxpd=0.083 othpotxpd=0.083 beanxpd=0 othvegxpd=0.286 pizzaxpd=0.033 salsaxpd=0 tomscxpd=0.083 cheesexpd=0.5 whgbrdxpd=0.286
 brricexpd=0.033 candyxpd=0.143 donutxpd=0.143 cakexpd=0 icecrmxpd=0.033 popcornxpd=0.033 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1
 _N_=13
 NOTE: Invalid numeric data, cereal1fc='Multigrain' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='apple jacks' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=A DSQ_010=E food_code_1=Multigrain food_code_2=apple jacks DSQ_030=E DSQ_xx4=F DSQ_xx4os=rice
 DSQ_040=F DSQ_050=D DSQ_060=F DSQ_070=B DSQ_080=F DSQ_090=F DSQ_100=C DSQ_110=C DSQ_120=B DSQ_210=D DSQ_130=E DSQ_150=A DSQ_140=C
 DSQ_160=C DSQ_190=E DSQ_170=C DSQ_180=D DSQ_200=F DSQ_220=D DSQ_230=A DSQ_240=B DSQ_250=C DSQ_260=B ageinyr=99 gender=.
 cereal1fc=Multigrain cereal2fc=apple jacks numcer=0 hccerxpd=0.286 milkxpd=0.286 sodaxpd=0.5 frtjcxpd=0.143 swtctxpd=0.5
 energyxpd=0.033 fruitxpd=0.5 saladxpd=0.5 frfryxpd=0.083 othpotxpd=0.083 beanxpd=0.033 othvegxpd=0.286 pizzaxpd=0.083 salsaxpd=0
 tomscxpd=0.083 cheesexpd=0.286 whgbrdxpd=0.5 brricexpd=0.143 candyxpd=0.143 donutxpd=0 cakexpd=0.033 icecrmxpd=0.083
 popcornxpd=0.033 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=16
 NOTE: Invalid numeric data, cereal1fc='Oats' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='NONE' , at line 321 column 23.
DSQ_xx1=27 DSQ_xx2=b DSQ_010=F food_code_1=Oats food_code_2=NONE DSQ_030=F DSQ_xx4=B DSQ_xx4os=  DSQ_040=G DSQ_050=D
 DSQ_060=F DSQ_070=I DSQ_080=E DSQ_090=C DSQ_100=C DSQ_110=E DSQ_120=F DSQ_210=A DSQ_130=A DSQ_150=E DSQ_140=D DSQ_160=E DSQ_190=F
 DSQ_170=F DSQ_180=C DSQ_200=E DSQ_220=E DSQ_230=C DSQ_240=C DSQ_250=C DSQ_260=C ageinyr=99 gender=. cereal1fc=Oats cereal2fc=NONE
 numcer=0 hccerxpd=0.5 milkxpd=0.5 sodaxpd=0.786 frtjcxpd=0.143 swtctxpd=0.5 energyxpd=2.5 fruitxpd=0.286 saladxpd=0.083
 frfryxpd=0.083 othpotxpd=0.286 beanxpd=0.5 othvegxpd=0 pizzaxpd=0.143 salsaxpd=0.286 tomscxpd=0.286 cheesexpd=0.5 whgbrdxpd=0.286
 brricexpd=0 candyxpd=0.286 donutxpd=0.083 cakexpd=0.083 icecrmxpd=0.083 popcornxpd=0.083 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1
 _N_=17
 NOTE: Invalid numeric data, cereal1fc='Steel-cut oatmeal.' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='Granola' , at line 321 column 23.
 DSQ_xx1=26 DSQ_xx2=b DSQ_010=D food_code_1=Steel-cut oatmeal. food_code_2=Granola DSQ_030=E DSQ_xx4=A DSQ_xx4os= 
 DSQ_040=D DSQ_050=A DSQ_060=G DSQ_070=B DSQ_080=D DSQ_090=D DSQ_100=C DSQ_110=C DSQ_120=C DSQ_210=E DSQ_130=F DSQ_150=C DSQ_140=D
 DSQ_160=C DSQ_190=E DSQ_170=D DSQ_180=F DSQ_200=F DSQ_220=E DSQ_230=C DSQ_240=B DSQ_250=A DSQ_260=C ageinyr=99 gender=.
 cereal1fc=Steel-cut oatmeal. cereal2fc=Granola numcer=0 hccerxpd=0.143 milkxpd=0.286 sodaxpd=0.143 frtjcxpd=0 swtctxpd=0.786
 energyxpd=0.033 fruitxpd=0.143 saladxpd=0.143 frfryxpd=0.083 othpotxpd=0.083 beanxpd=0.083 othvegxpd=0.5 pizzaxpd=0.143
 salsaxpd=0.083 tomscxpd=0.083 cheesexpd=0.286 whgbrdxpd=0.5 brricexpd=0.286 candyxpd=0.286 donutxpd=0.083 cakexpd=0.033 icecrmxpd=0
 popcornxpd=0.083 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=18
 NOTE: Invalid numeric data, cereal1fc='oatmeal' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='none' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=C food_code_1=oatmeal food_code_2=none DSQ_030=G DSQ_xx4=A DSQ_xx4os=  DSQ_040=A DSQ_050=A
 DSQ_060=F DSQ_070=A DSQ_080=D DSQ_090=G DSQ_100=E DSQ_110=B DSQ_120=D DSQ_210=A DSQ_130=F DSQ_150=B DSQ_140=B DSQ_160=F DSQ_190=F
 DSQ_170=E DSQ_180=E DSQ_200=E DSQ_220=F DSQ_230=B DSQ_240=C DSQ_250=C DSQ_260=C ageinyr=99 gender=. cereal1fc=oatmeal cereal2fc=none
 numcer=0 hccerxpd=0.083 milkxpd=0.786 sodaxpd=0 frtjcxpd=0 swtctxpd=0.5 energyxpd=0 fruitxpd=0.143 saladxpd=0.786 frfryxpd=0.286
 othpotxpd=0.033 beanxpd=0.143 othvegxpd=0.5 pizzaxpd=0.033 salsaxpd=0.033 tomscxpd=0.5 cheesexpd=0.5 whgbrdxpd=0.286 brricexpd=0
 candyxpd=0.5 donutxpd=0.033 cakexpd=0.083 icecrmxpd=0.083 popcornxpd=0.083 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=19
 NOTE: Invalid numeric data, cereal1fc='cream of wheat' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='no' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=A DSQ_010=F food_code_1=cream of wheat food_code_2=no DSQ_030=F DSQ_xx4=B DSQ_xx4os=  DSQ_040=B
 DSQ_050=G DSQ_060=J DSQ_070=F DSQ_080=H DSQ_090=H DSQ_100=E DSQ_110=E DSQ_120=C DSQ_210=F DSQ_130=G DSQ_150=C DSQ_140=E DSQ_160=F
 DSQ_190=G DSQ_170=F DSQ_180=F DSQ_200=G DSQ_220=C DSQ_230=C DSQ_240=C DSQ_250=C DSQ_260=F ageinyr=99 gender=.
 cereal1fc=cream of wheat cereal2fc=no numcer=0 hccerxpd=0.5 milkxpd=0.5 sodaxpd=0.033 frtjcxpd=0.786 swtctxpd=4.5 energyxpd=0.5
 fruitxpd=1 saladxpd=1 frfryxpd=0.286 othpotxpd=0.286 beanxpd=0.083 othvegxpd=0.786 pizzaxpd=0.286 salsaxpd=0.083 tomscxpd=0.5
 cheesexpd=0.786 whgbrdxpd=0.786 brricexpd=0.5 candyxpd=0.083 donutxpd=0.083 cakexpd=0.083 icecrmxpd=0.083 popcornxpd=0.5 bcage=10
 kidgrp=0 teengrp=0 _ERROR_=1 _N_=20
 NOTE: Invalid numeric data, cereal1fc='granola' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='none' , at line 321 column 23.
  DSQ_xx1=26 DSQ_xx2=A DSQ_010=E food_code_1=granola food_code_2=none DSQ_030=A DSQ_xx4=  DSQ_xx4os=  DSQ_040=A DSQ_050=F
 DSQ_060=A DSQ_070=E DSQ_080=I DSQ_090=I DSQ_100=C DSQ_110=F DSQ_120=F DSQ_210=G DSQ_130=H DSQ_150=C DSQ_140=D DSQ_160=D DSQ_190=G
 DSQ_170=E DSQ_180=F DSQ_200=E DSQ_220=F DSQ_230=B DSQ_240=D DSQ_250=E DSQ_260=E ageinyr=99 gender=. cereal1fc=granola cereal2fc=none
 numcer=0 hccerxpd=0.286 milkxpd=0 sodaxpd=0 frtjcxpd=0.5 swtctxpd=0 energyxpd=0.286 fruitxpd=2 saladxpd=2 frfryxpd=0.083
 othpotxpd=0.5 beanxpd=0.5 othvegxpd=1 pizzaxpd=0.143 salsaxpd=0.083 tomscxpd=0.143 cheesexpd=0.786 whgbrdxpd=0.286 brricexpd=0.786
 candyxpd=0.5 donutxpd=0.033 cakexpd=0.143 icecrmxpd=0.286 popcornxpd=0.286 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=21
 NOTE: Invalid numeric data, cereal1fc='Life, Quakers' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='None' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=C food_code_1=Life, Quakers food_code_2=None DSQ_030=B DSQ_xx4=A DSQ_xx4os=  DSQ_040=A
 DSQ_050=C DSQ_060=A DSQ_070=A DSQ_080=C DSQ_090=F DSQ_100=C DSQ_110=C DSQ_120=C DSQ_210=A DSQ_130=F DSQ_150=A DSQ_140=C DSQ_160=C
 DSQ_190=F DSQ_170=E DSQ_180=D DSQ_200=F DSQ_220=C DSQ_230=A DSQ_240=C DSQ_250=B DSQ_260=C ageinyr=99 gender=.
 cereal1fc=Life, Quakers cereal2fc=None numcer=0 hccerxpd=0.083 milkxpd=0.033 sodaxpd=0 frtjcxpd=0.083 swtctxpd=0 energyxpd=0
 fruitxpd=0.083 saladxpd=0.5 frfryxpd=0.083 othpotxpd=0.083 beanxpd=0.083 othvegxpd=0.5 pizzaxpd=0.083 salsaxpd=0 tomscxpd=0.083
 cheesexpd=0.5 whgbrdxpd=0.5 brricexpd=0 candyxpd=0.083 donutxpd=0 cakexpd=0.083 icecrmxpd=0.033 popcornxpd=0.083 bcage=10 kidgrp=0
 teengrp=0 _ERROR_=1 _N_=25
 NOTE: Invalid numeric data, cereal1fc='Cheerios' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='N/A' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=A DSQ_010=E food_code_1=Cheerios food_code_2=N/A DSQ_030=E DSQ_xx4=B DSQ_xx4os=  DSQ_040=D DSQ_050=B
 DSQ_060=A DSQ_070=D DSQ_080=G DSQ_090=H DSQ_100=A DSQ_110=G DSQ_120=A DSQ_210=A DSQ_130=A DSQ_150=A DSQ_140=B DSQ_160=A DSQ_190=E
 DSQ_170=D DSQ_180=F DSQ_200=A DSQ_220=I DSQ_230=B DSQ_240=H DSQ_250=H DSQ_260=B ageinyr=99 gender=. cereal1fc=Cheerios cereal2fc=N/A
 numcer=0 hccerxpd=0.286 milkxpd=0.286 sodaxpd=0.143 frtjcxpd=0.033 swtctxpd=0 energyxpd=0.143 fruitxpd=0.786 saladxpd=1 frfryxpd=0
 othpotxpd=0.786 beanxpd=0 othvegxpd=0 pizzaxpd=0.033 salsaxpd=0 tomscxpd=0 cheesexpd=0.286 whgbrdxpd=0 brricexpd=0 candyxpd=2
 donutxpd=0.033 cakexpd=1 icecrmxpd=1 popcornxpd=0.033 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=27
 NOTE: Invalid numeric data, cereal1fc='grain' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='na' , at line 321 column 23.
 DSQ_xx1=26 DSQ_xx2=A DSQ_010=C food_code_1=grain food_code_2=na DSQ_030=F DSQ_xx4=B DSQ_xx4os=  DSQ_040=A DSQ_050=A
 DSQ_060=J DSQ_070=F DSQ_080=E DSQ_090=H DSQ_100=F DSQ_110=A DSQ_120=D DSQ_210=E DSQ_130=E DSQ_150=D DSQ_140=D DSQ_160=D DSQ_190=C
 DSQ_170=F DSQ_180=F DSQ_200=H DSQ_220=E DSQ_230=C DSQ_240=B DSQ_250=D DSQ_260=A ageinyr=99 gender=. cereal1fc=grain cereal2fc=na
 numcer=0 hccerxpd=0.083 milkxpd=0.5 sodaxpd=0 frtjcxpd=0 swtctxpd=4.5 energyxpd=0.5 fruitxpd=0.286 saladxpd=1 frfryxpd=0.5
 othpotxpd=0 beanxpd=0.143 othvegxpd=0.286 pizzaxpd=0.143 salsaxpd=0.143 tomscxpd=0.143 cheesexpd=0.083 whgbrdxpd=1 brricexpd=0.286
 candyxpd=0.286 donutxpd=0.083 cakexpd=0.033 icecrmxpd=0.143 popcornxpd=0 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=28
 NOTE: Invalid numeric data, cereal1fc='kix' , at line 321 column 6.
  DSQ_xx1=26 DSQ_xx2=A DSQ_010=E food_code_1=kix food_code_2=  DSQ_030=E DSQ_xx4=C DSQ_xx4os=  DSQ_040=H DSQ_050=E
 DSQ_060=A DSQ_070=G DSQ_080=G DSQ_090=F DSQ_100=E DSQ_110=D DSQ_120=C DSQ_210=B DSQ_130=E DSQ_150=C DSQ_140=D DSQ_160=D DSQ_190=G
 DSQ_170=F DSQ_180=F DSQ_200=F DSQ_220=E DSQ_230=E DSQ_240=E DSQ_250=D DSQ_260=B ageinyr=99 gender=. cereal1fc=kix cereal2fc= 
 numcer=0 hccerxpd=0.286 milkxpd=0.286 sodaxpd=1 frtjcxpd=0.286 swtctxpd=0 energyxpd=0.786 fruitxpd=0.786 saladxpd=0.5 frfryxpd=0.286
 othpotxpd=0.143 beanxpd=0.083 othvegxpd=0.286 pizzaxpd=0.143 salsaxpd=0.083 tomscxpd=0.143 cheesexpd=0.786 whgbrdxpd=0.5
 brricexpd=0.033 candyxpd=0.286 donutxpd=0.286 cakexpd=0.286 icecrmxpd=0.143 popcornxpd=0.033 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1
 _N_=29
 NOTE: Invalid numeric data, cereal1fc='oatmeal' , at line 321 column 6.
 WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=C food_code_1=oatmeal food_code_2=  DSQ_030=A DSQ_xx4=  DSQ_xx4os=  DSQ_040=B DSQ_050=B
 DSQ_060=D DSQ_070=A DSQ_080=G DSQ_090=D DSQ_100=C DSQ_110=C DSQ_120=A DSQ_210=C DSQ_130=F DSQ_150=A DSQ_140=D DSQ_160=A DSQ_190=F
 DSQ_170=C DSQ_180=E DSQ_200=E DSQ_220=E DSQ_230=A DSQ_240=E DSQ_250=A DSQ_260=B ageinyr=99 gender=. cereal1fc=oatmeal cereal2fc= 
 numcer=0 hccerxpd=0.083 milkxpd=0 sodaxpd=0.033 frtjcxpd=0.033 swtctxpd=0.143 energyxpd=0 fruitxpd=0.786 saladxpd=0.143
 frfryxpd=0.083 othpotxpd=0.083 beanxpd=0 othvegxpd=0.5 pizzaxpd=0.143 salsaxpd=0 tomscxpd=0 cheesexpd=0.5 whgbrdxpd=0.286
 brricexpd=0.083 candyxpd=0.286 donutxpd=0 cakexpd=0.286 icecrmxpd=0 popcornxpd=0.033 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=30
 NOTE: There were 34 observations read from the data set WORK.YOURDATA.
 NOTE: The data set WORK.DTQ has 34 observations and 63 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.01 seconds
       cpu time            0.01 seconds
       

 

11 REPLIES 11
Reeza
Super User

I suspect this is an issue with having XLSX files. Try converting them to CSV, read them in and enforce your types first will solve this. There is no good way in SAS to ensure that data from XLSX files are read correctly, especially since Excel does not enforce types (a column can have character and numeric values) and that doesn't work for analysis.  

 


@alexist wrote:

I am getting the "invalid numeric data" note multiple times and I am unsure why. I have included the code and the notes below. I see that the name of cereal in the note, but I do not know where it is specified as a numeric value. Thank you for any help provided!

 

Code: 

Filename yourdata '/folders/myfolders/sasuser.v94/excel/Diet_data.csv';
proc import datafile=yourdata
  out=work.yourdata
  dbms=csv
  replace;
run;





/*

  The following files are contained within the archive that 

  contained this analysis program.  Once extracted from the archive, 

  these files should be located in the same folder/directory as 

  the analysis program.

*/  



  libname ntile xlsx '/folders/myfolders/sasuser.v94/excel/calib.DSQ.cereal.ntile.xlsx'; 

  libname psize xlsx '/folders/myfolders/sasuser.v94/excel/calib.portion.size.xlsx';

  libname rcoeff xlsx '/folders/myfolders/sasuser.v94/excel/calib.equation.coeff.xlsx'; 





proc format;  

  value gender 1='male'

               2='female';



run;



data dtq;

  set yourdata;



/*this program uses variables names:

    DSQ_xx1

    DSQ_xx2

    DSQ_010, DSQ_030, etc



 ***PLEASE NOTE SPECIAL CEREAL RECODING IS REQUIRED BEFORE RUNNING THIS CODE****



 DSQ_020 and DSQ_xx3 MUST be converted to an 8 digit foodcode by the user



 The current variables (DSQ_020 and DSQ_xx3) are character variables that represent

 assorted cereals.  Using the 'calib.DSQ.cereal.ntile.xlsx' file, the user

 must create new variables, which will be called:



   food_code_1 and

   food_code_2



 and contain an eight digit FNDDS foodcode which represents the particular cereal

 that was reported.  If only one cereal is reported,  food_code_2 should remain blank.



*/



/*in this data step, create variables: 

  Required names include: ageinyr (age in years) gender (1=male 2=female)  

  and the food ffq - each food has two variables, times and units 

*/



  ageinyr=DSQ_xx1;

  if DSQ_xx2='1' then gender=1;			

    else if DSQ_xx2='2' then gender=2;



  cereal1fc=food_code_1;

  cereal2fc=food_code_2;



/*create numcer to represent the number of cereals provided;

*/



  if cereal1fc= . and cereal2fc= . then numcer=0;

    else if cereal1fc > 0 and cereal2fc > 0 then numcer=2;

    else if cereal1fc > 0 then numcer=1;





/*converting responses into times per day for food variables of interest;

*/



 %macro foodrange (in,out,maxv);

 if &in='A' then &out=0;

   else if &in='B' then &out=0.033;

   else if &in='C' then &out=0.083;

   else if &in='D' then &out=0.143;

   else if &in='E' then &out=0.286;

   else if &in='F' then &out=0.5;

   else if &in='G' then &out=0.786;

   else if &in='H' then &out=1;

   else if &in='I' then &out=2;

    *top code outliers;

   if &out > &maxv then &out=&maxv;    

%mend foodrange;



%macro bevrange (in,out,maxv);

 if &in='A' then &out=0;

   else if &in='B' then &out=0.033;

   else if &in='C' then &out=0.083;

   else if &in='D' then &out=0.143;

   else if &in='E' then &out=0.286;

   else if &in='F' then &out=0.5;

   else if &in='G' then &out=0.786;

   else if &in='H' then &out=1;

   else if &in='I' then &out=2.5;

   else if &in='J' then &out=4.5;

   else if &in='K' then &out=6;

    *top code outliers;

   if &out > &maxv then &out=&maxv;  

%mend bevrange;



  %foodrange(dsq_010,hccerxpd,7);

  %bevrange(dsq_030,milkxpd,10);

  %bevrange(dsq_040,sodaxpd,8);

  %bevrange(dsq_050,frtjcxpd,8);

  %bevrange(dsq_060,swtctxpd,10);

  %bevrange(dsq_070,energyxpd,7);

  %foodrange(dsq_080,fruitxpd,8);

  %foodrange(dsq_090,saladxpd,5);

  %foodrange(dsq_100,frfryxpd,5);

  %foodrange(dsq_110,othpotxpd,3);

  %foodrange(dsq_120,beanxpd,4);

  %foodrange(dsq_130,othvegxpd,5);

  %foodrange(dsq_140,pizzaxpd,2);

  %foodrange(dsq_150,salsaxpd,3);

  %foodrange(dsq_160,tomscxpd,2);

  %foodrange(dsq_190,cheesexpd,6);

  %foodrange(dsq_200,whgbrdxpd,6);

  %foodrange(dsq_210,brricexpd,4);

  %foodrange(dsq_220,candyxpd,8);

  %foodrange(dsq_230,donutxpd,5);

  %foodrange(dsq_240,cakexpd,7);

  %foodrange(dsq_250,icecrmxpd,5);

  %foodrange(dsq_260,popcornxpd,3);



  label hccerxpd='number of times per day eat hot or cold cereal'
        milkxpd='number of times per day drink milk'
	sodaxpd='number of times per day drink soda'
	frtjcxpd='number of times per day drink fruit juice'
	swtctxpd='number of times per day drink sweet coffee/tea'
	energyxpd='number of times per day drink fruit/sports/energy drink'
	fruitxpd='number of times per day eat fruit'
	saladxpd='number of times per day eat salad'
	frfryxpd='number of times per day eat fried potatoes'
	othpotxpd='number of times per day eat other potatoes'
	beanxpd='number of times per day eat beans'
	othvegxpd='number of times per day eat other vegetables'
	pizzaxpd='number of times per day eat pizza'
	salsaxpd='number of times per day eat salsa'
	tomscxpd='number of times per day eat tomtato sauce'
	cheesexpd='number of times per day eat cheese'
	whgbrdxpd='number of times per day eat whole grain bread'
	brricexpd='number of times per day eat cooked whole grain (brown rice)'
	candyxpd='number of times per day eat candy'
	donutxpd='number of times per day eat pastries'
	cakexpd='number of times per day eat cookies/cake'
	icecrmxpd='number of times per day eat ice cream'
	popcornxpd='number of times per day eat pop corn';

   if (2 <= ageinyr <= 3) then bcage=1;
    else if (4 <= ageinyr <= 5) then bcage=2;
    else if (6 <= ageinyr <= 7) then bcage=3;
    else if (8 <= ageinyr <= 9) then bcage=4;
    else if (10 <= ageinyr <= 11) then bcage=5;
    else if (12 <= ageinyr <= 13) then bcage=6;
    else if (14 <= ageinyr <= 15) then bcage=7;
    else if (16 <= ageinyr <= 17) then bcage=8;
    else if (18 <= ageinyr <= 25) then bcage=9;
    else if (26 <= ageinyr <= 35) then bcage=10;
    else if (36 <= ageinyr <= 45) then bcage=11;
    else if (46 <= ageinyr <= 60) then bcage=12;
    else if (61 <= ageinyr <= 69) then bcage=13;
    else if (70 <= ageinyr <= 99) then bcage=14;

    *make age dummy variables ****;

    if (2 <= ageinyr <= 11) then kidgrp=1;
      else kidgrp=0;
    if (12 <= ageinyr <= 17) then teengrp=1;
      else teengrp=0;

run 

 

 

 

 

Notes: 

 491        run;
 
 NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
       321:6    321:23   323:13   323:31   325:13   
 NOTE: Invalid numeric data, cereal1fc='Steel cut oats' , at line 321 column 6.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=C food_code_1=Steel cut oats food_code_2=  DSQ_030=F DSQ_xx4=A DSQ_xx4os=  DSQ_040=C
 DSQ_050=E DSQ_060=A DSQ_070=A DSQ_080=H DSQ_090=H DSQ_100=G DSQ_110=D DSQ_120=D DSQ_210=E DSQ_130=H DSQ_150=B DSQ_140=B DSQ_160=E
 DSQ_190=F DSQ_170=E DSQ_180=C DSQ_200=C DSQ_220=D DSQ_230=A DSQ_240=C DSQ_250=E DSQ_260=A ageinyr=99 gender=.
 cereal1fc=Steel cut oats cereal2fc=  numcer=0 hccerxpd=0.083 milkxpd=0.5 sodaxpd=0.083 frtjcxpd=0.286 swtctxpd=0 energyxpd=0
 fruitxpd=1 saladxpd=1 frfryxpd=0.786 othpotxpd=0.143 beanxpd=0.143 othvegxpd=1 pizzaxpd=0.033 salsaxpd=0.033 tomscxpd=0.286
 cheesexpd=0.5 whgbrdxpd=0.083 brricexpd=0.286 candyxpd=0.143 donutxpd=0 cakexpd=0.083 icecrmxpd=0.286 popcornxpd=0 bcage=10 kidgrp=0
 teengrp=0 _ERROR_=1 _N_=1
 NOTE: Invalid numeric data, cereal1fc='chex' , at line 321 column 6.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=E food_code_1=chex food_code_2=  DSQ_030=E DSQ_xx4=B DSQ_xx4os=  DSQ_040=B DSQ_050=A
 DSQ_060=I DSQ_070=C DSQ_080=H DSQ_090=G DSQ_100=E DSQ_110=F DSQ_120=C DSQ_210=A DSQ_130=F DSQ_150=C DSQ_140=B DSQ_160=C DSQ_190=C
 DSQ_170=E DSQ_180=C DSQ_200=B DSQ_220=F DSQ_230=B DSQ_240=D DSQ_250=E DSQ_260=D ageinyr=99 gender=. cereal1fc=chex cereal2fc= 
 numcer=0 hccerxpd=0.286 milkxpd=0.286 sodaxpd=0.033 frtjcxpd=0 swtctxpd=2.5 energyxpd=0.083 fruitxpd=1 saladxpd=0.786 frfryxpd=0.286
 othpotxpd=0.5 beanxpd=0.083 othvegxpd=0.5 pizzaxpd=0.033 salsaxpd=0.083 tomscxpd=0.083 cheesexpd=0.083 whgbrdxpd=0.033 brricexpd=0
 candyxpd=0.5 donutxpd=0.033 cakexpd=0.143 icecrmxpd=0.286 popcornxpd=0.143 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=2
 NOTE: Invalid numeric data, cereal1fc='raisin bran' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='special k red berries' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=F food_code_1=raisin bran food_code_2=special k red berries DSQ_030=F DSQ_xx4=B DSQ_xx4os= 
 DSQ_040=A DSQ_050=C DSQ_060=I DSQ_070=B DSQ_080=I DSQ_090=E DSQ_100=D DSQ_110=C DSQ_120=B DSQ_210=C DSQ_130=G DSQ_150=C DSQ_140=C
 DSQ_160=C DSQ_190=E DSQ_170=E DSQ_180=D DSQ_200=H DSQ_220=D DSQ_230=D DSQ_240=E DSQ_250=D DSQ_260=A ageinyr=99 gender=.
 cereal1fc=raisin bran cereal2fc=special k red berries numcer=0 hccerxpd=0.5 milkxpd=0.5 sodaxpd=0 frtjcxpd=0.083 swtctxpd=2.5
 energyxpd=0.033 fruitxpd=2 saladxpd=0.286 frfryxpd=0.143 othpotxpd=0.083 beanxpd=0.033 othvegxpd=0.786 pizzaxpd=0.083 salsaxpd=0.083
 tomscxpd=0.083 cheesexpd=0.286 whgbrdxpd=1 brricexpd=0.083 candyxpd=0.143 donutxpd=0.143 cakexpd=0.286 icecrmxpd=0.143 popcornxpd=0
 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=4
 NOTE: Invalid numeric data, cereal1fc='cheerios' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='none' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=E food_code_1=cheerios food_code_2=none DSQ_030=D DSQ_xx4=A DSQ_xx4os=  DSQ_040=F DSQ_050=D
 DSQ_060=E DSQ_070=A DSQ_080=H DSQ_090=I DSQ_100=C DSQ_110=D DSQ_120=C DSQ_210=F DSQ_130=I DSQ_150=E DSQ_140=C DSQ_160=D DSQ_190=G
 DSQ_170=E DSQ_180=C DSQ_200=F DSQ_220=H DSQ_230=B DSQ_240=B DSQ_250=D DSQ_260=D ageinyr=99 gender=. cereal1fc=cheerios
 cereal2fc=none numcer=0 hccerxpd=0.286 milkxpd=0.143 sodaxpd=0.5 frtjcxpd=0.143 swtctxpd=0.286 energyxpd=0 fruitxpd=1 saladxpd=2
 frfryxpd=0.083 othpotxpd=0.143 beanxpd=0.083 othvegxpd=2 pizzaxpd=0.083 salsaxpd=0.286 tomscxpd=0.143 cheesexpd=0.786 whgbrdxpd=0.5
 brricexpd=0.5 candyxpd=1 donutxpd=0.033 cakexpd=0.033 icecrmxpd=0.143 popcornxpd=0.143 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=5
 NOTE: Invalid numeric data, cereal1fc='steel cut oats' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='none' , at line 321 column 23.
 DSQ_xx1=26 DSQ_xx2=b DSQ_010=C food_code_1=steel cut oats food_code_2=none DSQ_030=A DSQ_xx4=  DSQ_xx4os=  DSQ_040=B
 DSQ_050=C DSQ_060=A DSQ_070=A DSQ_080=E DSQ_090=H DSQ_100=C DSQ_110=B DSQ_120=C DSQ_210=D DSQ_130=H DSQ_150=F DSQ_140=C DSQ_160=C
 DSQ_190=C DSQ_170=A DSQ_180=C DSQ_200=B DSQ_220=E DSQ_230=A DSQ_240=C DSQ_250=A DSQ_260=D ageinyr=99 gender=.
 cereal1fc=steel cut oats cereal2fc=none numcer=0 hccerxpd=0.083 milkxpd=0 sodaxpd=0.033 frtjcxpd=0.083 swtctxpd=0 energyxpd=0
 fruitxpd=0.286 saladxpd=1 frfryxpd=0.083 othpotxpd=0.033 beanxpd=0.083 othvegxpd=1 pizzaxpd=0.083 salsaxpd=0.5 tomscxpd=0.083
 cheesexpd=0.083 whgbrdxpd=0.033 brricexpd=0.143 candyxpd=0.286 donutxpd=0 cakexpd=0.083 icecrmxpd=0 popcornxpd=0.143 bcage=10
 kidgrp=0 teengrp=0 _ERROR_=1 _N_=6
 NOTE: Invalid numeric data, cereal1fc='oatmeal' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='grits' , at line 321 column 23. DSQ_xx1=26 DSQ_xx2=b DSQ_010=C food_code_1=oatmeal food_code_2=grits DSQ_030=A DSQ_xx4=  DSQ_xx4os=  DSQ_040=F DSQ_050=C
 DSQ_060=C DSQ_070=E DSQ_080=D DSQ_090=C DSQ_100=E DSQ_110=D DSQ_120=C DSQ_210=A DSQ_130=E DSQ_150=A DSQ_140=C DSQ_160=D DSQ_190=E
 DSQ_170=E DSQ_180=D DSQ_200=C DSQ_220=C DSQ_230=D DSQ_240=C DSQ_250=D DSQ_260=B ageinyr=99 gender=. cereal1fc=oatmeal
 cereal2fc=grits numcer=0 hccerxpd=0.083 milkxpd=0 sodaxpd=0.5 frtjcxpd=0.083 swtctxpd=0.083 energyxpd=0.286 fruitxpd=0.143
 saladxpd=0.083 frfryxpd=0.286 othpotxpd=0.143 beanxpd=0.083 othvegxpd=0.286 pizzaxpd=0.083 salsaxpd=0 tomscxpd=0.143 cheesexpd=0.286
 whgbrdxpd=0.083 brricexpd=0 candyxpd=0.083 donutxpd=0.143 cakexpd=0.083 icecrmxpd=0.143 popcornxpd=0.033 bcage=10 kidgrp=0 teengrp=0
 _ERROR_=1 _N_=7
 NOTE: Invalid numeric data, cereal1fc='coco crispies' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='n/a' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=C food_code_1=coco crispies food_code_2=n/a DSQ_030=D DSQ_xx4=C DSQ_xx4os=  DSQ_040=E
 DSQ_050=C DSQ_060=C DSQ_070=D DSQ_080=B DSQ_090=C DSQ_100=C DSQ_110=B DSQ_120=D DSQ_210=A DSQ_130=C DSQ_150=C DSQ_140=C DSQ_160=B
 DSQ_190=E DSQ_170=D DSQ_180=E DSQ_200=E DSQ_220=C DSQ_230=A DSQ_240=B DSQ_250=A DSQ_260=B ageinyr=99 gender=.
 cereal1fc=coco crispies cereal2fc=n/a numcer=0 hccerxpd=0.083 milkxpd=0.143 sodaxpd=0.286 frtjcxpd=0.083 swtctxpd=0.083
 energyxpd=0.143 fruitxpd=0.033 saladxpd=0.083 frfryxpd=0.083 othpotxpd=0.033 beanxpd=0.143 othvegxpd=0.083 pizzaxpd=0.083
 salsaxpd=0.083 tomscxpd=0.033 cheesexpd=0.286 whgbrdxpd=0.286 brricexpd=0 candyxpd=0.083 donutxpd=0 cakexpd=0.033 icecrmxpd=0
 popcornxpd=0.033 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=8
 NOTE: Invalid numeric data, cereal1fc='Reese's Puffs' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='NONE' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=B food_code_1=Reese's Puffs food_code_2=NONE DSQ_030=A DSQ_xx4=  DSQ_xx4os=  DSQ_040=C
 DSQ_050=A DSQ_060=A DSQ_070=A DSQ_080=E DSQ_090=E DSQ_100=D DSQ_110=D DSQ_120=B DSQ_210=A DSQ_130=H DSQ_150=F DSQ_140=D DSQ_160=D
 DSQ_190=H DSQ_170=D DSQ_180=C DSQ_200=E DSQ_220=D DSQ_230=D DSQ_240=D DSQ_250=D DSQ_260=B ageinyr=99 gender=.
 cereal1fc=Reese's Puffs cereal2fc=NONE numcer=0 hccerxpd=0.033 milkxpd=0 sodaxpd=0.083 frtjcxpd=0 swtctxpd=0 energyxpd=0
 fruitxpd=0.286 saladxpd=0.286 frfryxpd=0.143 othpotxpd=0.143 beanxpd=0.033 othvegxpd=1 pizzaxpd=0.143 salsaxpd=0.5 tomscxpd=0.143
 cheesexpd=1 whgbrdxpd=0.286 brricexpd=0 candyxpd=0.143 donutxpd=0.143 cakexpd=0.143 icecrmxpd=0.143 popcornxpd=0.033 bcage=10
 kidgrp=0 teengrp=0 _ERROR_=1 _N_=12
 NOTE: Invalid numeric data, cereal1fc='Cheerios' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='None' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=F food_code_1=Cheerios food_code_2=None DSQ_030=F DSQ_xx4=B DSQ_xx4os=  DSQ_040=C DSQ_050=E
 DSQ_060=F DSQ_070=A DSQ_080=C DSQ_090=E DSQ_100=C DSQ_110=C DSQ_120=A DSQ_210=B DSQ_130=E DSQ_150=A DSQ_140=B DSQ_160=C DSQ_190=F
 DSQ_170=E DSQ_180=C DSQ_200=E DSQ_220=D DSQ_230=D DSQ_240=A DSQ_250=B DSQ_260=B ageinyr=99 gender=. cereal1fc=Cheerios
 cereal2fc=None numcer=0 hccerxpd=0.5 milkxpd=0.5 sodaxpd=0.083 frtjcxpd=0.286 swtctxpd=0.5 energyxpd=0 fruitxpd=0.083 saladxpd=0.286
 frfryxpd=0.083 othpotxpd=0.083 beanxpd=0 othvegxpd=0.286 pizzaxpd=0.033 salsaxpd=0 tomscxpd=0.083 cheesexpd=0.5 whgbrdxpd=0.286
 brricexpd=0.033 candyxpd=0.143 donutxpd=0.143 cakexpd=0 icecrmxpd=0.033 popcornxpd=0.033 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1
 _N_=13
 NOTE: Invalid numeric data, cereal1fc='Multigrain' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='apple jacks' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=A DSQ_010=E food_code_1=Multigrain food_code_2=apple jacks DSQ_030=E DSQ_xx4=F DSQ_xx4os=rice
 DSQ_040=F DSQ_050=D DSQ_060=F DSQ_070=B DSQ_080=F DSQ_090=F DSQ_100=C DSQ_110=C DSQ_120=B DSQ_210=D DSQ_130=E DSQ_150=A DSQ_140=C
 DSQ_160=C DSQ_190=E DSQ_170=C DSQ_180=D DSQ_200=F DSQ_220=D DSQ_230=A DSQ_240=B DSQ_250=C DSQ_260=B ageinyr=99 gender=.
 cereal1fc=Multigrain cereal2fc=apple jacks numcer=0 hccerxpd=0.286 milkxpd=0.286 sodaxpd=0.5 frtjcxpd=0.143 swtctxpd=0.5
 energyxpd=0.033 fruitxpd=0.5 saladxpd=0.5 frfryxpd=0.083 othpotxpd=0.083 beanxpd=0.033 othvegxpd=0.286 pizzaxpd=0.083 salsaxpd=0
 tomscxpd=0.083 cheesexpd=0.286 whgbrdxpd=0.5 brricexpd=0.143 candyxpd=0.143 donutxpd=0 cakexpd=0.033 icecrmxpd=0.083
 popcornxpd=0.033 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=16
 NOTE: Invalid numeric data, cereal1fc='Oats' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='NONE' , at line 321 column 23.
DSQ_xx1=27 DSQ_xx2=b DSQ_010=F food_code_1=Oats food_code_2=NONE DSQ_030=F DSQ_xx4=B DSQ_xx4os=  DSQ_040=G DSQ_050=D
 DSQ_060=F DSQ_070=I DSQ_080=E DSQ_090=C DSQ_100=C DSQ_110=E DSQ_120=F DSQ_210=A DSQ_130=A DSQ_150=E DSQ_140=D DSQ_160=E DSQ_190=F
 DSQ_170=F DSQ_180=C DSQ_200=E DSQ_220=E DSQ_230=C DSQ_240=C DSQ_250=C DSQ_260=C ageinyr=99 gender=. cereal1fc=Oats cereal2fc=NONE
 numcer=0 hccerxpd=0.5 milkxpd=0.5 sodaxpd=0.786 frtjcxpd=0.143 swtctxpd=0.5 energyxpd=2.5 fruitxpd=0.286 saladxpd=0.083
 frfryxpd=0.083 othpotxpd=0.286 beanxpd=0.5 othvegxpd=0 pizzaxpd=0.143 salsaxpd=0.286 tomscxpd=0.286 cheesexpd=0.5 whgbrdxpd=0.286
 brricexpd=0 candyxpd=0.286 donutxpd=0.083 cakexpd=0.083 icecrmxpd=0.083 popcornxpd=0.083 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1
 _N_=17
 NOTE: Invalid numeric data, cereal1fc='Steel-cut oatmeal.' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='Granola' , at line 321 column 23.
 DSQ_xx1=26 DSQ_xx2=b DSQ_010=D food_code_1=Steel-cut oatmeal. food_code_2=Granola DSQ_030=E DSQ_xx4=A DSQ_xx4os= 
 DSQ_040=D DSQ_050=A DSQ_060=G DSQ_070=B DSQ_080=D DSQ_090=D DSQ_100=C DSQ_110=C DSQ_120=C DSQ_210=E DSQ_130=F DSQ_150=C DSQ_140=D
 DSQ_160=C DSQ_190=E DSQ_170=D DSQ_180=F DSQ_200=F DSQ_220=E DSQ_230=C DSQ_240=B DSQ_250=A DSQ_260=C ageinyr=99 gender=.
 cereal1fc=Steel-cut oatmeal. cereal2fc=Granola numcer=0 hccerxpd=0.143 milkxpd=0.286 sodaxpd=0.143 frtjcxpd=0 swtctxpd=0.786
 energyxpd=0.033 fruitxpd=0.143 saladxpd=0.143 frfryxpd=0.083 othpotxpd=0.083 beanxpd=0.083 othvegxpd=0.5 pizzaxpd=0.143
 salsaxpd=0.083 tomscxpd=0.083 cheesexpd=0.286 whgbrdxpd=0.5 brricexpd=0.286 candyxpd=0.286 donutxpd=0.083 cakexpd=0.033 icecrmxpd=0
 popcornxpd=0.083 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=18
 NOTE: Invalid numeric data, cereal1fc='oatmeal' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='none' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=C food_code_1=oatmeal food_code_2=none DSQ_030=G DSQ_xx4=A DSQ_xx4os=  DSQ_040=A DSQ_050=A
 DSQ_060=F DSQ_070=A DSQ_080=D DSQ_090=G DSQ_100=E DSQ_110=B DSQ_120=D DSQ_210=A DSQ_130=F DSQ_150=B DSQ_140=B DSQ_160=F DSQ_190=F
 DSQ_170=E DSQ_180=E DSQ_200=E DSQ_220=F DSQ_230=B DSQ_240=C DSQ_250=C DSQ_260=C ageinyr=99 gender=. cereal1fc=oatmeal cereal2fc=none
 numcer=0 hccerxpd=0.083 milkxpd=0.786 sodaxpd=0 frtjcxpd=0 swtctxpd=0.5 energyxpd=0 fruitxpd=0.143 saladxpd=0.786 frfryxpd=0.286
 othpotxpd=0.033 beanxpd=0.143 othvegxpd=0.5 pizzaxpd=0.033 salsaxpd=0.033 tomscxpd=0.5 cheesexpd=0.5 whgbrdxpd=0.286 brricexpd=0
 candyxpd=0.5 donutxpd=0.033 cakexpd=0.083 icecrmxpd=0.083 popcornxpd=0.083 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=19
 NOTE: Invalid numeric data, cereal1fc='cream of wheat' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='no' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=A DSQ_010=F food_code_1=cream of wheat food_code_2=no DSQ_030=F DSQ_xx4=B DSQ_xx4os=  DSQ_040=B
 DSQ_050=G DSQ_060=J DSQ_070=F DSQ_080=H DSQ_090=H DSQ_100=E DSQ_110=E DSQ_120=C DSQ_210=F DSQ_130=G DSQ_150=C DSQ_140=E DSQ_160=F
 DSQ_190=G DSQ_170=F DSQ_180=F DSQ_200=G DSQ_220=C DSQ_230=C DSQ_240=C DSQ_250=C DSQ_260=F ageinyr=99 gender=.
 cereal1fc=cream of wheat cereal2fc=no numcer=0 hccerxpd=0.5 milkxpd=0.5 sodaxpd=0.033 frtjcxpd=0.786 swtctxpd=4.5 energyxpd=0.5
 fruitxpd=1 saladxpd=1 frfryxpd=0.286 othpotxpd=0.286 beanxpd=0.083 othvegxpd=0.786 pizzaxpd=0.286 salsaxpd=0.083 tomscxpd=0.5
 cheesexpd=0.786 whgbrdxpd=0.786 brricexpd=0.5 candyxpd=0.083 donutxpd=0.083 cakexpd=0.083 icecrmxpd=0.083 popcornxpd=0.5 bcage=10
 kidgrp=0 teengrp=0 _ERROR_=1 _N_=20
 NOTE: Invalid numeric data, cereal1fc='granola' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='none' , at line 321 column 23.
  DSQ_xx1=26 DSQ_xx2=A DSQ_010=E food_code_1=granola food_code_2=none DSQ_030=A DSQ_xx4=  DSQ_xx4os=  DSQ_040=A DSQ_050=F
 DSQ_060=A DSQ_070=E DSQ_080=I DSQ_090=I DSQ_100=C DSQ_110=F DSQ_120=F DSQ_210=G DSQ_130=H DSQ_150=C DSQ_140=D DSQ_160=D DSQ_190=G
 DSQ_170=E DSQ_180=F DSQ_200=E DSQ_220=F DSQ_230=B DSQ_240=D DSQ_250=E DSQ_260=E ageinyr=99 gender=. cereal1fc=granola cereal2fc=none
 numcer=0 hccerxpd=0.286 milkxpd=0 sodaxpd=0 frtjcxpd=0.5 swtctxpd=0 energyxpd=0.286 fruitxpd=2 saladxpd=2 frfryxpd=0.083
 othpotxpd=0.5 beanxpd=0.5 othvegxpd=1 pizzaxpd=0.143 salsaxpd=0.083 tomscxpd=0.143 cheesexpd=0.786 whgbrdxpd=0.286 brricexpd=0.786
 candyxpd=0.5 donutxpd=0.033 cakexpd=0.143 icecrmxpd=0.286 popcornxpd=0.286 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=21
 NOTE: Invalid numeric data, cereal1fc='Life, Quakers' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='None' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=C food_code_1=Life, Quakers food_code_2=None DSQ_030=B DSQ_xx4=A DSQ_xx4os=  DSQ_040=A
 DSQ_050=C DSQ_060=A DSQ_070=A DSQ_080=C DSQ_090=F DSQ_100=C DSQ_110=C DSQ_120=C DSQ_210=A DSQ_130=F DSQ_150=A DSQ_140=C DSQ_160=C
 DSQ_190=F DSQ_170=E DSQ_180=D DSQ_200=F DSQ_220=C DSQ_230=A DSQ_240=C DSQ_250=B DSQ_260=C ageinyr=99 gender=.
 cereal1fc=Life, Quakers cereal2fc=None numcer=0 hccerxpd=0.083 milkxpd=0.033 sodaxpd=0 frtjcxpd=0.083 swtctxpd=0 energyxpd=0
 fruitxpd=0.083 saladxpd=0.5 frfryxpd=0.083 othpotxpd=0.083 beanxpd=0.083 othvegxpd=0.5 pizzaxpd=0.083 salsaxpd=0 tomscxpd=0.083
 cheesexpd=0.5 whgbrdxpd=0.5 brricexpd=0 candyxpd=0.083 donutxpd=0 cakexpd=0.083 icecrmxpd=0.033 popcornxpd=0.083 bcage=10 kidgrp=0
 teengrp=0 _ERROR_=1 _N_=25
 NOTE: Invalid numeric data, cereal1fc='Cheerios' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='N/A' , at line 321 column 23.
DSQ_xx1=26 DSQ_xx2=A DSQ_010=E food_code_1=Cheerios food_code_2=N/A DSQ_030=E DSQ_xx4=B DSQ_xx4os=  DSQ_040=D DSQ_050=B
 DSQ_060=A DSQ_070=D DSQ_080=G DSQ_090=H DSQ_100=A DSQ_110=G DSQ_120=A DSQ_210=A DSQ_130=A DSQ_150=A DSQ_140=B DSQ_160=A DSQ_190=E
 DSQ_170=D DSQ_180=F DSQ_200=A DSQ_220=I DSQ_230=B DSQ_240=H DSQ_250=H DSQ_260=B ageinyr=99 gender=. cereal1fc=Cheerios cereal2fc=N/A
 numcer=0 hccerxpd=0.286 milkxpd=0.286 sodaxpd=0.143 frtjcxpd=0.033 swtctxpd=0 energyxpd=0.143 fruitxpd=0.786 saladxpd=1 frfryxpd=0
 othpotxpd=0.786 beanxpd=0 othvegxpd=0 pizzaxpd=0.033 salsaxpd=0 tomscxpd=0 cheesexpd=0.286 whgbrdxpd=0 brricexpd=0 candyxpd=2
 donutxpd=0.033 cakexpd=1 icecrmxpd=1 popcornxpd=0.033 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=27
 NOTE: Invalid numeric data, cereal1fc='grain' , at line 321 column 6.
 NOTE: Invalid numeric data, cereal2fc='na' , at line 321 column 23.
 DSQ_xx1=26 DSQ_xx2=A DSQ_010=C food_code_1=grain food_code_2=na DSQ_030=F DSQ_xx4=B DSQ_xx4os=  DSQ_040=A DSQ_050=A
 DSQ_060=J DSQ_070=F DSQ_080=E DSQ_090=H DSQ_100=F DSQ_110=A DSQ_120=D DSQ_210=E DSQ_130=E DSQ_150=D DSQ_140=D DSQ_160=D DSQ_190=C
 DSQ_170=F DSQ_180=F DSQ_200=H DSQ_220=E DSQ_230=C DSQ_240=B DSQ_250=D DSQ_260=A ageinyr=99 gender=. cereal1fc=grain cereal2fc=na
 numcer=0 hccerxpd=0.083 milkxpd=0.5 sodaxpd=0 frtjcxpd=0 swtctxpd=4.5 energyxpd=0.5 fruitxpd=0.286 saladxpd=1 frfryxpd=0.5
 othpotxpd=0 beanxpd=0.143 othvegxpd=0.286 pizzaxpd=0.143 salsaxpd=0.143 tomscxpd=0.143 cheesexpd=0.083 whgbrdxpd=1 brricexpd=0.286
 candyxpd=0.286 donutxpd=0.083 cakexpd=0.033 icecrmxpd=0.143 popcornxpd=0 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=28
 NOTE: Invalid numeric data, cereal1fc='kix' , at line 321 column 6.
  DSQ_xx1=26 DSQ_xx2=A DSQ_010=E food_code_1=kix food_code_2=  DSQ_030=E DSQ_xx4=C DSQ_xx4os=  DSQ_040=H DSQ_050=E
 DSQ_060=A DSQ_070=G DSQ_080=G DSQ_090=F DSQ_100=E DSQ_110=D DSQ_120=C DSQ_210=B DSQ_130=E DSQ_150=C DSQ_140=D DSQ_160=D DSQ_190=G
 DSQ_170=F DSQ_180=F DSQ_200=F DSQ_220=E DSQ_230=E DSQ_240=E DSQ_250=D DSQ_260=B ageinyr=99 gender=. cereal1fc=kix cereal2fc= 
 numcer=0 hccerxpd=0.286 milkxpd=0.286 sodaxpd=1 frtjcxpd=0.286 swtctxpd=0 energyxpd=0.786 fruitxpd=0.786 saladxpd=0.5 frfryxpd=0.286
 othpotxpd=0.143 beanxpd=0.083 othvegxpd=0.286 pizzaxpd=0.143 salsaxpd=0.083 tomscxpd=0.143 cheesexpd=0.786 whgbrdxpd=0.5
 brricexpd=0.033 candyxpd=0.286 donutxpd=0.286 cakexpd=0.286 icecrmxpd=0.143 popcornxpd=0.033 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1
 _N_=29
 NOTE: Invalid numeric data, cereal1fc='oatmeal' , at line 321 column 6.
 WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.
DSQ_xx1=26 DSQ_xx2=b DSQ_010=C food_code_1=oatmeal food_code_2=  DSQ_030=A DSQ_xx4=  DSQ_xx4os=  DSQ_040=B DSQ_050=B
 DSQ_060=D DSQ_070=A DSQ_080=G DSQ_090=D DSQ_100=C DSQ_110=C DSQ_120=A DSQ_210=C DSQ_130=F DSQ_150=A DSQ_140=D DSQ_160=A DSQ_190=F
 DSQ_170=C DSQ_180=E DSQ_200=E DSQ_220=E DSQ_230=A DSQ_240=E DSQ_250=A DSQ_260=B ageinyr=99 gender=. cereal1fc=oatmeal cereal2fc= 
 numcer=0 hccerxpd=0.083 milkxpd=0 sodaxpd=0.033 frtjcxpd=0.033 swtctxpd=0.143 energyxpd=0 fruitxpd=0.786 saladxpd=0.143
 frfryxpd=0.083 othpotxpd=0.083 beanxpd=0 othvegxpd=0.5 pizzaxpd=0.143 salsaxpd=0 tomscxpd=0 cheesexpd=0.5 whgbrdxpd=0.286
 brricexpd=0.083 candyxpd=0.286 donutxpd=0 cakexpd=0.286 icecrmxpd=0 popcornxpd=0.033 bcage=10 kidgrp=0 teengrp=0 _ERROR_=1 _N_=30
 NOTE: There were 34 observations read from the data set WORK.YOURDATA.
 NOTE: The data set WORK.DTQ has 34 observations and 63 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.01 seconds
       cpu time            0.01 seconds
       

 


 

Astounding
PROC Star

Your program refers to CEREAL1FC (and CEREAL2FC as well) as if it were a numeric variable:

 

if cereal1fc= . and cereal2fc= . then numcer=0;

else if cereal1fc > 0 and cereal2fc > 0 then numcer=2;
else if cereal1fc > 0 then numcer=1;

 

However, it is actually a character string with values like 'Steel cut oats'

 

So putting it into numeric formulas will not work properly.

alexist
Obsidian | Level 7

Hello @Astounding

 

Thank you! How would I change it to a character format? I'm new to SAS so I am confused. 

 

Thank you again for you help.

Astounding
PROC Star

It's already character.  I'm not sure what you would want to change about that.  Here's one of the many notes from the log:

 

Invalid numeric data, cereal1fc='Steel-cut oatmeal.'

 

You can see the values for yourself.  Try running:

 

proc freq data=have;

tables cereal1fc;

run;

 

In your program, you can use it along the lines of:

 

if cereal1fc='Steel-cut oatmeal' then do;

alexist
Obsidian | Level 7

@Astounding

 

Ok. I have an excel sheet with a few hundred cereal types that SAS should be using to change the characters (i.e. steel cut oatmeal) to an 8 digit numeric code. Would I need to do "if cereal1fc='Steel-cut oatmeal' then do;" for every single cereal type? 

 

Thanks. 

Reeza
Super User

@alexist wrote:

@Astounding

 

Ok. I have an excel sheet with a few hundred cereal types that SAS should be using to change the characters (i.e. steel cut oatmeal) to an 8 digit numeric code. Would I need to do "if cereal1fc='Steel-cut oatmeal' then do;" for every single cereal type? 

 

Thanks. 


Well you have to tell SAS somehow that 0001000 is Steel cut oatmeal. It’s generally considered a look up problem, so if you have the data in another data set you can do a join via SQL or data step merge. I generally prefer user defined formats myself, to avoid the IF/THEN statements and to keep the code clean. You can also create a UDF from a data set using the CNTLIN option.

Astounding
PROC Star

From my point of view, all answers begin with, "Move your spreadsheet data into a SAS data set."  That's the only way I would be qualified to answer your questions.

alexist
Obsidian | Level 7

Ok, thank you for your help! I really appreciate it. 

ballardw
Super User

@alexist wrote:

@Astounding

 

Ok. I have an excel sheet with a few hundred cereal types that SAS should be using to change the characters (i.e. steel cut oatmeal) to an 8 digit numeric code. Would I need to do "if cereal1fc='Steel-cut oatmeal' then do;" for every single cereal type? 

 

Thanks. 


If the list of numeric values is relatively stable, i.e. it doesn't change every time you use it, a common way to handle this is to use a custom informat (and an associated format to display the character value when needed).

Proc format library=work;
/* INVALUE says I am going to create an informat*/
/* the upcase tells SAS to use the upper case of the 
character value before comparing to the list, so "a" or "A"
both will yield the numeric value 10001000
Since the name of the informat does not start with $
SAS expects to create numeric values from the given
characters. The "other" is what to do if a value
not on your list is encountered. In this case it provides
an invalid data error message you may seen before
*/
invalue Char2Num (upcase)
'A' = 10001000
'B' = 10001100
'CAN' = 99999999
other=_error_
;
run;

data example;
   informat x char2num.;
   input x;
datalines;
a
B
caN
dog
;
run;

 

if you have the list in a data set you could use that to make a format, write format code or do a table look up.

Reeza
Super User

I think I'm wrong but you didn't give us enough to go on. The full log with the line numbers is what you need. 

 

 NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
       321:6    321:23   323:13   323:31   325:13  

 

When you run the code, check those lines in the log code, which are numbered. It literally tells you go to line 321, and the function that's likely starting at the 6th character, and then again at 23 in your program and check that line of code which has errors. 

Then again for line 323 and 325. You did not include the full log though.  

 

 

ballardw
Super User

This code:

if cereal1fc= . and cereal2fc= . then numcer=0;
 else if cereal1fc > 0 and cereal2fc > 0 then numcer=2;
 else if cereal1fc > 0 then numcer=1;

is attempting to compare the value of cereal1fc with the numeric value of 0. SAS is not telling that the variable is numeric only that the attempted use was.

The values appearing in your data for cereal1fc are 'Steel cut oats', 'chex' and other CHARACTER values. So there is no "valid" numeric value to compare with zero. SAS will attempt to convert a character value to numeric to perform the comparison. That is the cause of the warning: Character values have been converted to numeric ...

 

If the character variable contains something like "123" then that would be the only message. But you get the invalid because SAS has no internal rule on how to convert "chex" to a numeric value.

The same thing is happening with the other variable cereal2fc.

 

So what actual comparison do you want to do with "chex" or "Steel cut oats"? Perhaps you used ">0" in an attempt to test that the variable was not blank. In which case the proper approach would be to use one of the missing functions.

Perhaps:

Numcer = 2-cmiss(cereal1fc,cereal2fc);

cmiss returns the number of missing values for variables. If none are missing then cmiss would return 0, 1 if only one of the variables is missing values and 2 if both.

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 11 replies
  • 2294 views
  • 3 likes
  • 4 in conversation