hello,
Do you know how to fill value with zero and reach a tens digit?
for table have
have |
CIK |
915913 |
1029506 |
3673 |
75677 |
0001091530 |
I expect to get table want
want |
CIK |
0000915913 |
0001029506 |
0000003673 |
0000075677 |
0001091530 |
thanks in davance.
data table1; infile cards truncover; input CIK $100. ; cards; 915913 1029506 3673 75677 0001091530 ;
Use the Z. format.
cik = put( input(cik, 10.), z10.) ;
Use the Z. format.
cik = put( input(cik, 10.), z10.) ;
@Alexxxxxxx wrote:
hello,
Do you know how to fill value with zero and reach a tens digit?
for table have
have CIK 915913 1029506 3673 75677 0001091530 I expect to get table want
want CIK 0000915913 0001029506 0000003673 0000075677 0001091530
thanks in davance.
data table1; infile cards truncover; input CIK $100. ; cards; 915913 1029506 3673 75677 0001091530 ;
You have just shown why CIK (central index key from the SEC I presume) should always be treated a a character variable.
Try this (I replaced your $100. with $10.):
data table1;
infile cards truncover;
input cik $10.
cik=translate(right(cik),'0',' ');
cards;
915913
1029506
3673
75677
0001091530
;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.