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

Good Morning,

 

I'm wondering if anyone can give me direction on how to remove the state from where my city column is listed. Screen Shot 2020-11-05 at 9.42.25 AM.png

^That is the first data line, I am trying to remove Mississippi and just have Blue Mountain independently. 

 

Here is my code, 

DATA WORK.C;

SET Hyp.C ( KEEP = SocSecNum FirstInit MiddleInit LastInit CityState ZipCd
RENAME = (SocSecNum = SSN )
);

LENGTH Inits $3
City $20
StateCd$2;

Inits = COMPRESS(CATS(FirstInit, MiddleInit, LastInit), '.');

City = SCAN(CityState,1,'.');

Format StateCd $StateCd.;

RUN;

 

This is the first two observations that my code produces:

Screen Shot 2020-11-05 at 9.44.13 AM.png

Thanks in advance for the advice. 

 

Best,

 

Neeloo

1 ACCEPTED SOLUTION
2 REPLIES 2
neeloofar
Fluorite | Level 6

Wow, so simple, I overlooked it, thank you so much!!