BookmarkSubscribeRSS Feed
KoKo312
Calcite | Level 5

DATA FINAL;

SET WORK.EMSM;

PARENT=CHILD;

I've tried several different ways Rename, Attrib, Format functions and nothing is working. The child values are 4 digits (ex.0001).

 

HERE'S MY CODE

Data final (RENAME=(CHILD=CHILDnum));

SET WORK.EMSM ;

PARENT=CHILD;

CHILD=PUT(CHILDnum, 4.);

DROP=CHILDnum;

RUN;

1 REPLY 1
Larrihoover
Obsidian | Level 7
I think you are looking for a z4. format from the question but not positive. Check out this explanation and see if that is what you are looking for: https://communities.sas.com/t5/SAS-Procedures/how-to-pad-character-variable-with-leading-zeroes/td-p...

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 1340 views
  • 0 likes
  • 2 in conversation