BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ballardw
Super User

I will say that I am often too lazy to try to work out all of the says SQL needs to be set up with groups and such try to do any kind of complicated summary.

 

 

Tom
Super User Tom
Super User

You did something wrong.  If you have 64 datasets then the same name cannot be both numeric and character in all 64 datasets.

 

If this is a one off problem just craft the code by hand instead of trying to get too complex in doing metadata analysis with code.

 

Here is the structure you will need.  Let's just assume that BDATE is the only problem variable.  So in this example any dataset where BDATE is char we add the RENAME= dataset option to rename BDATE to BDATE_CHAR.  Then you can also add some code to try to convert the numeric BDATE variables in date strings to store in BDATE_CHAR.  Whether that is really what you want to do depends on what type of gibberish you actually have in those fields.

 

I am not going to retype your dataset names from the photographs you keep pasting (why do people of the trouble of making screen grabs and figuring out how to post them into this forum instead of just copying and pasting the text????)  so I will just make up a couple of dataset names to show the pattern.

data want;
  length ac_pay 8 acc_sta $62 bdate 8  bdate_char $10 ...... ;
  set input.argentina
      input.brazil (rename=(bdate=bdate_char))
      ...
  ;
  bdate_char=coalescec(bdate_char,put(bdate,yymmdd10.));
run;
Tom
Super User Tom
Super User

Use SUM() instead of COUN()

sum(type=1)
Phil_NZ
Barite | Level 11
Hi @Tom

Yes, it works, when we change from count to sum.

Many thanks and warmest regards.
Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 18 replies
  • 4410 views
  • 12 likes
  • 6 in conversation