Hi,
I have a string, Let it be 'GOOD'. Now I want to create a array with the length of the string i.e 4(here length of the string GOOD is 4). And I want to take each character of GOOD into each array element and I want to concatenate all the four array elements. Finally the result would be GOOD only.
Here the length may vary each time that is instead of GOOD i may pass THIS IS SAS
In SAS arrays have fixed length defined when the code is compiled. The associative array (hash) is a dynamic sized object so you may consider that option.
However I don't see the point of your question. State the problem again in more detail.
While you do that you may consider this bit
Provide some input/output examples.
Pulling individual characters and then concatenating them back to a string really sounds like you may be needing one of Strip, Compress or some other string function instead.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.