BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
France
Quartz | Level 8

Dear all,

 

I'd like to read the data set which is added in the attachment.

 

in order to read complete value, I set the width as 40.20 , which like following codes

 

data sa_step1.GDP;
infile 'F:\Dataset\Control variables\Source\1.GDP World Development Indicators\Data_Extract_From_World_Development_Indicators.csv' DLM=',' DSD missover lrecl = 32767 firstobs =2 ;
  input 
        Country Name :$50. 
        Country Code :$29. 
        Series Name :$250. 
        Series Code :$250.  
        YR1980 :40.20 
        YR1981 :40.20 
        YR1982 :40.20 
        YR1983 :40.20 
        YR1984 :40.20 
        YR1985 :40.20 
        YR1986 :40.20 
        YR1987 :40.20 
        YR1991 :40.20 
        YR1992 :40.20 
        YR1993 :40.20 
        YR1994 :40.20 
        YR1995 :40.20 
        YR1996 :40.20 
        YR1997 :40.20 
        YR1998 :40.20 
        YR1999 :40.20 
        YR2000 :40.20 
        YR2001 :40.20 
        YR2002 :40.20 
        YR2006 :40.20 
        YR2007 :40.20 
        YR2008 :40.20 
        YR2009 :40.20 
        YR2010 :40.20 
        YR2011 :40.20 
        YR2012 :40.20 
        YR2013 :40.20 
        YR2014 :40.20 
        YR2015 :40.20 
        YR2016 :40.20 
        YR2017 :40.20 
;
run;

but the result shows that 

 

629  data sa_step1.GDP;
630  infile 'F:\Dataset\Control variables\Source\1.GDP World Development
630! Indicators\Data_Extract_From_World_Development_Indicators.csv' DLM=',' DSD missover lrecl = 32767
630!  firstobs =2 ;
631    input
632          Country Name :$50.
633          Country Code :$29.
634          Series Name :$250.
635          Series Code :$250.
636          YR1980 :40.20
                     -----
                     499
637          YR1981 :40.20
                     -----
                     499
638          YR1982 :40.20
                     -----
                     499
639          YR1983 :40.20
                     -----
                     499
640          YR1984 :40.20
                     -----
                     499
641          YR1985 :40.20
                     -----
                     499
642          YR1986 :40.20
                     -----
                     499
643          YR1987 :40.20
                     -----
                     499
644          YR1991 :40.20
                     -----
                     499
645          YR1992 :40.20
                     -----
                     499
646          YR1993 :40.20
                     -----
                     499
647          YR1994 :40.20
                     -----
                     499
648          YR1995 :40.20
                     -----
                     499
649          YR1996 :40.20
                     -----
                     499
650          YR1997 :40.20
                     -----
                     499
651          YR1998 :40.20
                     -----
                     499
652          YR1999 :40.20
                     -----
                     499
653          YR2000 :40.20
                     -----
                     499
654          YR2001 :40.20
                     -----
                     499
655          YR2002 :50.20
                     -----
                     499
656          YR2006 :50.20
                     -----
                     499
657          YR2007 :50.20
                     -----
                     499
658          YR2008 :50.20
                     -----
                     499
659          YR2009 :50.20
                     -----
                     499
660          YR2010 :50.20
                     -----
                     499
661          YR2011 :50.20
                     -----
                     499
662          YR2012 :50.20
                     -----
                     499
663          YR2013 :50.20
                     -----
                     499
664          YR2014 :50.20
                     -----
                     499
665          YR2015 :50.20
                     -----
                     499
666          YR2016 :50.20
                     -----
                     499
667          YR2017 :50.20
                     -----
                     499
ERROR 499-185: Width specified for informat F is invalid.

668  ;
669  run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set SA_STEP1.GDP may be incomplete.  When this step was stopped there were 0
         observations and 36 variables.
WARNING: Data set SA_STEP1.GDP was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.39 seconds
      cpu time            0.06 seconds

could you please give me some suggestions?

 

thanks in advance.

best regards,

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

A brief tutorial on reading one of these messages. When the rule is displayed such as

RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9--
2         Afghanistan,AFG,GDP (constant 2010 US$),NY.GDP.MKTP.KD,..,..,..,..,..,..,..,..,..,..,..,..,.

The numbers on the RULE: line appear at each 10 character spaces and + at each 5.

 

So the note:

NOTE: Invalid data for YR1980 in line 2 56-57.

tells you the program was reading the variable YR1980 starting at position 56. Go to the column  immediately after the + after the 5. That will be position 56. On line 2 (the number at the left above) you will see .. Those character appear in your data. An hence are invalid data. Your program has no problem. The Notes are telling that you may have a problem with data, and in this case the values in your data file are invalid for numeric variables. So the values of the variable are set to missing and you get the note.

 

 

If you expect numeric values to be present for all variables talk to the source of the data file you are reading. It is very likely that some of the values were not available for given years and in that case the file creator indicated that with the two periods for some reason. There are options to turn that type of note off but I don't recommend it in case other issues crop up with other variables.

If the Note of invalid data for those bother you then you can create a custom INFORMAT that will assign a missing value to the two periods without the notes. Example:

proc format library=work;
invalue twodot
'..' = .
other = [32.16]
;
run;

and use the TWODOT. informat on the input instead of 32.16

 

View solution in original post

9 REPLIES 9
novinosrin
Tourmaline | Level 20

Numeric Informat rule violation

 


w.d Informat

Reads standard numeric data.
Category: Numeric
Alias: BESTw.d, Dw.d, Ew.d, Fw.d
Syntax
Syntax Description
Details
Comparisons
Examples
Syntax
w.d

Syntax Description

w
specifies the width of the input field.

Range: 1-32
d
specifies the power of 10 by which to divide the value. If the data contain decimal points, the d value is ignored. This argument is optional.

Range: 0-31

 

 

France
Quartz | Level 8

Dear novinosrin,

 

thanks for your suggestion.

by using the following code,

data sa_step1.GDP;
infile 'F:\Dataset\Control variables\Source\1.GDP World Development Indicators\Data_Extract_From_World_Development_Indicators.csv' DLM=',' DSD missover lrecl = 32767 firstobs =2 ;
  input 
        Country Name :$50. 
        Country Code :$29. 
        Series Name :$250. 
        Series Code :$250.  
        YR1980 :32.18 
        YR1981 :32.18 
        YR1982 :32.18 
        YR1983 :32.18
        YR1984 :32.18 
        YR1985 :32.18 
        YR1986 :32.18 
        YR1987 :32.18 
        YR1991 :32.18 
        YR1992 :32.18 
        YR1993 :32.18
        YR1994 :32.18 
        YR1995 :32.18 
        YR1996 :32.18 
        YR1997 :32.18 
        YR1998 :32.18 
        YR1999 :32.18 
        YR2000 :32.18 
        YR2001 :32.18 
        YR2002 :32.18
        YR2006 :32.18 
        YR2007 :32.18 
        YR2008 :32.18 
        YR2009 :32.18 
        YR2010 :32.18 
        YR2011 :32.18 
        YR2012 :32.18 
        YR2013 :32.18 
        YR2014 :32.18 
        YR2015 :32.18 
        YR2016 :32.18 
        YR2017 :32.18 
;
run;

I get 

NOTE: A byte-order mark in the file "F:\Dataset\Control variables\Source\1.GDP World Development
      Indicators\Data_Extract_From_World_Development_Indicators.csv" (for fileref "#LN00053")
      indicates that the data is encoded in "utf-8".  This encoding will be used to process the file.
NOTE: The infile 'F:\Dataset\Control variables\Source\1.GDP World Development
      Indicators\Data_Extract_From_World_Development_Indicators.csv' is:

      Filename=F:\Dataset\Control variables\Source\1.GDP World Development
      Indicators\Data_Extract_From_World_Development_Indicators.csv,
      RECFM=V,LRECL=131068,File Size (bytes)=2451486,
      Last Modified=27 September 2018 16:49:31 o'c,
      Create Time=27 September 2018 10:56:02 o'c

NOTE: Invalid data for Country in line 2 1-11.
NOTE: Invalid data for Country in line 2 17-39.
NOTE: Invalid data for Series in line 2 56-57.
NOTE: Invalid data for Series in line 2 62-63.
NOTE: Invalid data for YR1980 in line 2 68-69.
NOTE: Invalid data for YR1981 in line 2 71-72.
NOTE: Invalid data for YR1982 in line 2 74-75.
NOTE: Invalid data for YR1983 in line 2 77-78.
NOTE: Invalid data for YR1984 in line 2 80-81.
NOTE: Invalid data for YR1985 in line 2 83-84.
NOTE: Invalid data for YR1986 in line 2 86-87.
NOTE: Invalid data for YR1987 in line 2 89-90.
NOTE: Invalid data for YR1991 in line 2 92-93.
NOTE: Invalid data for YR1992 in line 2 95-96.
NOTE: Invalid data for YR1993 in line 2 98-99.
NOTE: Invalid data for YR1994 in line 2 101-102.
NOTE: Invalid data for YR1995 in line 2 104-105.
NOTE: Invalid data for YR1996 in line 2 107-108.
NOTE: Invalid data for YR1997 in line 2 110-111.
RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9--
2         Afghanistan,AFG,GDP (constant 2010 US$),NY.GDP.MKTP.KD,..,..,..,..,..,..,..,..,..,..,..,..,.
      93  .,..,..,..,..,..,..,8013233121.55065,10305228125.1392,11721187594.2052,12144482858.18,146973
     185  31940.6464,15936800636.2487,16911126453.2276,19352203805.6294,20107051005.0514,20648035625.4
     277  122,20918533234.6796,21413614653.3241,21969414112.4281 330
Country=. Name=.. Code=.. Series=. YR1980=. YR1981=. YR1982=. YR1983=. YR1984=. YR1985=. YR1986=.
YR1987=. YR1991=. YR1992=. YR1993=. YR1994=. YR1995=. YR1996=. YR1997=. YR1998=8013233121.6
YR1999=10305228125 YR2000=11721187594 YR2001=12144482858 YR2002=14697331941 YR2006=15936800636
YR2007=16911126453 YR2008=19352203806 YR2009=20107051005 YR2010=20648035625 YR2011=20918533235
YR2012=21413614653 YR2013=21969414112 YR2014=. YR2015=. YR2016=. YR2017=. _ERROR_=1 _N_=1
NOTE: Invalid data for Country in line 3 1-11.
NOTE: Invalid data for Country in line 3 17-34.
NOTE: Invalid data for Series in line 3 51-52.
NOTE: Invalid data for Series in line 3 57-58.
NOTE: Invalid data for YR1980 in line 3 63-64.
NOTE: Invalid data for YR1981 in line 3 66-67.
NOTE: Invalid data for YR1982 in line 3 69-70.
NOTE: Invalid data for YR1983 in line 3 72-73.
NOTE: Invalid data for YR1984 in line 3 75-76.
NOTE: Invalid data for YR1985 in line 3 78-79.
NOTE: Invalid data for YR1986 in line 3 81-82.
NOTE: Invalid data for YR1987 in line 3 84-85.
NOTE: Invalid data for YR1991 in line 3 87-88.
NOTE: Invalid data for YR1992 in line 3 90-91.
NOTE: Invalid data for YR1993 in line 3 93-94.
NOTE: Invalid data for YR1994 in line 3 96-97.
NOTE: Invalid data for YR1995 in line 3 99-100.
NOTE: Invalid data for YR1996 in line 3 102-103.
NOTE: Invalid data for YR1997 in line 3 105-106.
3         Afghanistan,AFG,GDP (constant LCU),NY.GDP.MKTP.KN,..,..,..,..,..,..,..,..,..,..,..,..,..,..,
      93  ..,..,..,..,..,185470260100,238519622700,271292707800,281090086900,340177046700,368865165200
     185  ,391416420100,447916367700,465387681000,477909038700,484169840200,495628745500,508493000000 275
Country=. Name=.. Code=.. Series=. YR1980=. YR1981=. YR1982=. YR1983=. YR1984=. YR1985=. YR1986=.
YR1987=. YR1991=. YR1992=. YR1993=. YR1994=. YR1995=. YR1996=. YR1997=. YR1998=1.8547026E-7
YR1999=2.3851962E-7 YR2000=2.7129271E-7 YR2001=2.8109009E-7 YR2002=3.4017705E-7 YR2006=3.6886517E-7
YR2007=3.9141642E-7 YR2008=4.4791637E-7 YR2009=4.6538768E-7 YR2010=4.7790904E-7 YR2011=4.8416984E-7
YR2012=4.9562875E-7 YR2013=5.08493E-7 YR2014=. YR2015=. YR2016=. YR2017=. _ERROR_=1 _N_=2

Could you please give me some suggestions about this ?

novinosrin
Tourmaline | Level 20

would 

Ew.d Informat



Reads numeric values that are stored in scientific notation and double-precision scientific notation help?

 

dm log 'clear';
data have;
infile cards truncover;
array yr(2002:2014) year2002-year2014;
input yr(*) : e.;
cards;
8013233122 10305228125 11721187594 12144482858 14697331941 15936800636 16911126453 19352203806 20107051005 20648035625 20918533235 21413614653 21969414112
1.8547E+11 2.3852E+11 2.71293E+11 2.8109E+11 3.40177E+11 3.68865E+11 3.91416E+11 4.47916E+11 4.65388E+11 4.77909E+11 4.8417E+11 4.95629E+11 5.08493E+11
1.85471E+11 3.52308E+11 4.90403E+11 5.19186E+11 6.15083E+11 7.29901E+11 8.56323E+11 1.06131E+12 1.14547E+12 1.1833E+12 1.22796E+12 1.32142E+12 1.42179E+12
4128820723 7057598407 9843842455 10190529882 12486943506 15936800636 17930239400 20536542737 20264253974 20616104298 19215562179 19469022208 20815300220
100.0002672 147.7058974 180.7654546 184.7045206 180.8126438 197.8773701 218.7754748 236.9442548 246.1327302 247.5990867 253.6207394 266.6146807 279.6079789
100.0002672 147.7058974 180.7654546 184.7045206 180.8126438 197.8773701 218.7754748 236.9442548 246.1327302 247.5990867 253.6207394 266.6146807 279.6079789
;
France
Quartz | Level 8
dear novinosrin,

could you please explain it in detail for me? I don't understand.
novinosrin
Tourmaline | Level 20

I was only suggesting to try using the e informat to read the year variables

ballardw
Super User

When you use this code

data sa_step1.GDP;
infile 'F:\Dataset\Control variables\Source\1.GDP World Development Indicators\Data_Extract_From_World_Development_Indicators.csv' DLM=',' DSD missover lrecl = 32767 firstobs =2 ;
  input 
        Country Name :$50. 
        Country Code :$29. 
        Series Name :$250. 
        Series Code :$250.  

SAS has been told that you are reading a variable named Country which without an informat specificied is assumed to be numeric.

 

SAS Variable names cannot generally contain spaces:

Replace the above section with

data sa_step1.GDP;
infile 'F:\Dataset\Control variables\Source\1.GDP World Development Indicators\Data_Extract_From_World_Development_Indicators.csv' DLM=',' DSD missover lrecl = 32767 firstobs =2 ;
  input 
        Country_Name :$50. 
        Country_Code :$29. 
        Series_Name :$250. 
        Series_Code :$250.

Also since the first variables attempted to use some of your columns you then last 4 variables did not have columns to read from

 

France
Quartz | Level 8

Dear ballardw,

 

thanks for your suggestion.

following the codes,

data sa_step1.GDP;
infile 'F:\Dataset\Control variables\Source\1.GDP World Development Indicators\Data_Extract_From_World_Development_Indicators.csv' DLM=',' DSD missover lrecl = 32767 firstobs =2 ;
  input 
        Country_Name :$50. 
        Country_Code :$29. 
        Series_Name :$250. 
        Series_Code :$250.  
        YR1980 :32.16 
        YR1981 :32.16 
        YR1982 :32.16 
        YR1983 :32.16
        YR1984 :32.16 
        YR1985 :32.16 
        YR1986 :32.16 
        YR1987 :32.16 
        YR1991 :32.16 
        YR1992 :32.16 
        YR1993 :32.16
        YR1994 :32.16 
        YR1995 :32.16 
        YR1996 :32.16 
        YR1997 :32.16 
        YR1998 :32.16 
        YR1999 :32.16 
        YR2000 :32.16 
        YR2001 :32.16 
        YR2002 :32.16 
        YR2006 :32.16 
        YR2007 :32.16 
        YR2008 :32.16  
        YR2009 :32.16  
        YR2010 :32.16  
        YR2011 :32.16  
        YR2012 :32.16  
        YR2013 :32.16  
        YR2014 :32.16  
        YR2015 :32.16  
        YR2016 :32.16  
        YR2017 :32.16  
;
run;

I still get the result like below,

NOTE: A byte-order mark in the file "F:\Dataset\Control variables\Source\1.GDP World Development
      Indicators\Data_Extract_From_World_Development_Indicators.csv" (for fileref "#LN00044")
      indicates that the data is encoded in "utf-8".  This encoding will be used to process the file.
NOTE: The infile 'F:\Dataset\Control variables\Source\1.GDP World Development
      Indicators\Data_Extract_From_World_Development_Indicators.csv' is:

      Filename=F:\Dataset\Control variables\Source\1.GDP World Development
      Indicators\Data_Extract_From_World_Development_Indicators.csv,
      RECFM=V,LRECL=131068,File Size (bytes)=2451486,
      Last Modified=27 September 2018 16:49:31 o'c,
      Create Time=27 September 2018 10:56:02 o'c

NOTE: Invalid data for YR1980 in line 2 56-57.
NOTE: Invalid data for YR1981 in line 2 59-60.
NOTE: Invalid data for YR1982 in line 2 62-63.
NOTE: Invalid data for YR1983 in line 2 65-66.
NOTE: Invalid data for YR1984 in line 2 68-69.
NOTE: Invalid data for YR1985 in line 2 71-72.
NOTE: Invalid data for YR1986 in line 2 74-75.
NOTE: Invalid data for YR1987 in line 2 77-78.
NOTE: Invalid data for YR1991 in line 2 80-81.
NOTE: Invalid data for YR1992 in line 2 83-84.
NOTE: Invalid data for YR1993 in line 2 86-87.
NOTE: Invalid data for YR1994 in line 2 89-90.
NOTE: Invalid data for YR1995 in line 2 92-93.
NOTE: Invalid data for YR1996 in line 2 95-96.
NOTE: Invalid data for YR1997 in line 2 98-99.
NOTE: Invalid data for YR1998 in line 2 101-102.
NOTE: Invalid data for YR1999 in line 2 104-105.
NOTE: Invalid data for YR2000 in line 2 107-108.
NOTE: Invalid data for YR2001 in line 2 110-111.
RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9--
2         Afghanistan,AFG,GDP (constant 2010 US$),NY.GDP.MKTP.KD,..,..,..,..,..,..,..,..,..,..,..,..,.
      93  .,..,..,..,..,..,..,8013233121.55065,10305228125.1392,11721187594.2052,12144482858.18,146973
     185  31940.6464,15936800636.2487,16911126453.2276,19352203805.6294,20107051005.0514,20648035625.4
     277  122,20918533234.6796,21413614653.3241,21969414112.4281 330
Country_Name=Afghanistan Country_Code=AFG Series_Name=GDP (constant 2010 US$)
Series_Code=NY.GDP.MKTP.KD YR1980=. YR1981=. YR1982=. YR1983=. YR1984=. YR1985=. YR1986=. YR1987=.
YR1991=. YR1992=. YR1993=. YR1994=. YR1995=. YR1996=. YR1997=. YR1998=. YR1999=. YR2000=. YR2001=.
YR2002=8013233121.6 YR2006=10305228125 YR2007=11721187594 YR2008=12144482858 YR2009=14697331941
YR2010=15936800636 YR2011=16911126453 YR2012=19352203806 YR2013=20107051005 YR2014=20648035625
YR2015=20918533235 YR2016=21413614653 YR2017=21969414112 _ERROR_=1 _N_=1



...
NOTE: Invalid data for YR1980 in line 21 68-69.
NOTE: Invalid data for YR1981 in line 21 71-72.
NOTE: Invalid data for YR1982 in line 21 74-75.
NOTE: Invalid data for YR1983 in line 21 77-78.
NOTE: Invalid data for YR1984 in line 21 80-81.
NOTE: Invalid data for YR1985 in line 21 83-84.
NOTE: Invalid data for YR1986 in line 21 86-87.
NOTE: Invalid data for YR1987 in line 21 89-90.
NOTE: Invalid data for YR1991 in line 21 92-93.
NOTE: Invalid data for YR1992 in line 21 95-96.
NOTE: Invalid data for YR1993 in line 21 98-99.
NOTE: Invalid data for YR1994 in line 21 101-102.
NOTE: Invalid data for YR1995 in line 21 104-105.
NOTE: Invalid data for YR1996 in line 21 107-108.
NOTE: Invalid data for YR1997 in line 21 110-111.
NOTE: Invalid data for YR1998 in line 21 113-114.
NOTE: Invalid data for YR1999 in line 21 116-117.
NOTE: Invalid data for YR2000 in line 21 119-120.
NOTE: Invalid data for YR2001 in line 21 122-123.
WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.
21        Afghanistan,AFG,GDP: linked series (current LCU),NY.GDP.MKTP.CN.AD,..,..,..,..,..,..,..,..,.
      93  .,..,..,..,..,..,..,..,..,..,..,185470755700,352307549100,490403496600,519186097400,61508311
     185  1900,729900688100,856323131400,1061312099400,1145471405100,1183298415200,1227955128600,13214
     277  18997400,1421787000000 298
Country_Name=Afghanistan Country_Code=AFG Series_Name=GDP: linked series (current LCU)
Series_Code=NY.GDP.MKTP.CN.AD YR1980=. YR1981=. YR1982=. YR1983=. YR1984=. YR1985=. YR1986=. YR1987=.
YR1991=. YR1992=. YR1993=. YR1994=. YR1995=. YR1996=. YR1997=. YR1998=. YR1999=. YR2000=. YR2001=.
YR2002=0.0000185471 YR2006=0.0000352308 YR2007=0.0000490403 YR2008=0.0000519186 YR2009=0.0000615083
YR2010=0.0000729901 YR2011=0.0000856323 YR2012=0.0001061312 YR2013=0.0001145471 YR2014=0.0001183298
YR2015=0.0001227955 YR2016=0.0001321419 YR2017=0.0001421787 _ERROR_=1 _N_=20
NOTE: 5285 records were read from the infile 'F:\Dataset\Control variables\Source\1.GDP World
      Development Indicators\Data_Extract_From_World_Development_Indicators.csv'.
      The minimum record length was 35.
      The maximum record length was 713.
NOTE: The data set SA_STEP1.GDP has 5285 observations and 36 variables.
NOTE: DATA statement used (Total process time):
      real time           0.58 seconds
      cpu time            0.24 seconds


could you please give me more advice?

 

ballardw
Super User

A brief tutorial on reading one of these messages. When the rule is displayed such as

RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9--
2         Afghanistan,AFG,GDP (constant 2010 US$),NY.GDP.MKTP.KD,..,..,..,..,..,..,..,..,..,..,..,..,.

The numbers on the RULE: line appear at each 10 character spaces and + at each 5.

 

So the note:

NOTE: Invalid data for YR1980 in line 2 56-57.

tells you the program was reading the variable YR1980 starting at position 56. Go to the column  immediately after the + after the 5. That will be position 56. On line 2 (the number at the left above) you will see .. Those character appear in your data. An hence are invalid data. Your program has no problem. The Notes are telling that you may have a problem with data, and in this case the values in your data file are invalid for numeric variables. So the values of the variable are set to missing and you get the note.

 

 

If you expect numeric values to be present for all variables talk to the source of the data file you are reading. It is very likely that some of the values were not available for given years and in that case the file creator indicated that with the two periods for some reason. There are options to turn that type of note off but I don't recommend it in case other issues crop up with other variables.

If the Note of invalid data for those bother you then you can create a custom INFORMAT that will assign a missing value to the two periods without the notes. Example:

proc format library=work;
invalue twodot
'..' = .
other = [32.16]
;
run;

and use the TWODOT. informat on the input instead of 32.16

 

France
Quartz | Level 8

Dear ballardw,

 

Really appreciate your help. I have created the table by using the following codes,

 

proc format library=work;
invalue twodot
'..' = .
other = [32.16]
;
run;

data sa_step1.GDP;
infile 'F:\Dataset\Control variables\Source\1.GDP World Development Indicators\eca1f3cd-082d-4f10-a504-2319bf5dbe50_Data.csv' DLM=',' DSD missover lrecl = 32767 firstobs =2 ;
  input 
        Country_Name :$50. 
        Country_Code :$29. 
        Series_Name :$250. 
        Series_Code :$250.  
        YR1980 :twodot. 
        YR1981 :twodot.
        YR1982 :twodot. 
        YR1983 :twodot.
        YR1984 :twodot.
        YR1985 :twodot. 
        YR1986 :twodot. 
        YR1987 :twodot. 
        YR1991 :twodot.  
        YR1992 :twodot.  
        YR1993 :twodot. 
        YR1994 :twodot.  
        YR1995 :twodot.  
        YR1996 :twodot.  
        YR1997 :twodot.  
        YR1998 :twodot.  
        YR1999 :twodot.  
        YR2000 :twodot.  
        YR2001 :twodot.  
        YR2002 :twodot.  
        YR2006 :twodot.  
        YR2007 :twodot.  
        YR2008 :twodot.   
        YR2009 :twodot.  
        YR2010 :twodot.  
        YR2011 :twodot.   
        YR2012 :twodot.  
        YR2013 :twodot.   
        YR2014 :twodot.  
        YR2015 :twodot.  
        YR2016 :twodot.   
        YR2017 :twodot.   
;

run;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 9 replies
  • 1984 views
  • 2 likes
  • 3 in conversation