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...

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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