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

Hi , Below is the code. Please elt me know why  I get blanks for the coulumns E to H and 'I' under the coumn  I instead of 'Yes'

 

data SAMPLE;

input A $ B $ C $ D
E F G H I $ ;
label A="A"
B="B"
C="C"
D="D";
E="E";
F="F";
G="G";
H="H";
I="I";


datalines;
CIT 05792 1/1/2016 225000 60000 1017815  4924600 233978 YES
CIT 05792 1/1/2016 225000 60000 1017815 4946901 472 YES
CARL 05295 1/1/2017 175000 50000 10187296 302304 136097 YES
CARL 05295 1/1/2017 175000 50000 10187296 900400 88954 YES

 

 

A        B          C             D          E F G H   I
CIT    05792 1/1/2016  225000 . . . .        I
CIT     05792 1/1/2016  225000 . . . .       I
CARL 05295 1/1/2017  175000 . . . .       I
CARL 05295 1/1/2017  175000 . . . .       I
;

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star
You have extra semicolons in the LABEL statement. Remove them (except the final one).

View solution in original post

7 REPLIES 7
Astounding
PROC Star
You have extra semicolons in the LABEL statement. Remove them (except the final one).
tomrvincent
Rhodochrosite | Level 12
your log will tell you why. E is numeric.
novinosrin
Tourmaline | Level 20

syntax issue in your label statement

 

correction:

 

data SAMPLE;
input A $ B $ C $ D E F G H I $ ;
label A="A"
B="B"
C="C"
D="D"
E="E"
F="F"
G="G"
H="H"
I="I";
datalines;
CIT 05792 1/1/2016 225000 60000 1017815  4924600 233978 YES
CIT 05792 1/1/2016 225000 60000 1017815 4946901 472 YES
CARL 05295 1/1/2017 175000 50000 10187296 302304 136097 YES
CARL 05295 1/1/2017 175000 50000 10187296 900400 88954 YES
;
PGStats
Opal | Level 21

Because you have semicolons in your LABEL statement, transforming it into a series of assignments.

PG
novinosrin
Tourmaline | Level 20

 

"transforming it into a series of assignments"

 

That's what makes Prodigygeniusstats aka PGstats exquisite, My oh My, that's attention to detail. Class!

 


@PGStats wrote:

Because you have semicolons in your LABEL statement, transforming it into a series of assignments.


 

DLROW
Quartz | Level 8

Thank you all!

Tom
Super User Tom
Super User

Your program/date works fine for me.

Something must have gotten lost in translating your code into your posting.

Perhaps you can post lines from your SAS log?  Make sure to use the insert Code pop-up window to preserve formatting.

 

data SAMPLE;
 input A $ B $ C $ D E F G H I $ ;
datalines;
CIT 05792 1/1/2016 225000 60000 1017815  4924600 233978 YES
CIT 05792 1/1/2016 225000 60000 1017815 4946901 472 YES
CARL 05295 1/1/2017 175000 50000 10187296 302304 136097 YES
CARL 05295 1/1/2017 175000 50000 10187296 900400 88954 YES
;
proc print;
run;

image.png

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 1027 views
  • 4 likes
  • 6 in conversation