DATA Step, Macro, Functions and more

How to Convert a number to character ID#

Reply
Occasional Learner
Posts: 1

How to Convert a number to character ID#

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;

Occasional Contributor
Posts: 16

Re: How to Convert a number to character ID#

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...
Ask a Question
Discussion stats
  • 1 reply
  • 79 views
  • 0 likes
  • 2 in conversation