BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Nietzsche
Lapis Lazuli | Level 10

Hi, I am reading page 148 of the official specialist prep guide, in it, it states that initial value can be character in the RETAIN statement, which is used for initialising a sum variable. But how can a character value be added together? How can A + A or A+1?

What circumstances can initial value be a character variable/value?

thanks

Nietzsche_0-1667853819264.png

 

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

I am reading page 148 of the official specialist prep guide, in it, it states that initial value can be character in the RETAIN statement, which is used for initialising a sum variable.

 

RETAIN does not have to be used for a sum variable. It can be used for many other purposes, such as retaining a character value from a previous observation. So, initialising a character variable with a character value makes perfect sense.

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

I am reading page 148 of the official specialist prep guide, in it, it states that initial value can be character in the RETAIN statement, which is used for initialising a sum variable.

 

RETAIN does not have to be used for a sum variable. It can be used for many other purposes, such as retaining a character value from a previous observation. So, initialising a character variable with a character value makes perfect sense.

--
Paige Miller
Nietzsche
Lapis Lazuli | Level 10

oh okay, thanks.

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).

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
  • 2 replies
  • 255 views
  • 0 likes
  • 2 in conversation