*New 11.3 series Release:
2019-10-19: XigmaNAS 11.3.0.4.7014 - released

*New 12.0 series Release:
2019-10-05: XigmaNAS 12.0.0.4.6928 - released!

*New 11.2 series Release:
2019-09-23: XigmaNAS 11.2.0.4.6881 - released!

We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS costs money. Please consider donating for our project so that we can continue to offer you the best.
We need your support! eg: PAYPAL

How to add zeros

Authenticating XigmaNAS users using Active Directory or NT PDC
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
kokilasoral
NewUser
NewUser
Posts: 1
Joined: 16 May 2016 13:37
Status: Offline

How to add zeros

#1

Post by kokilasoral » 18 May 2016 09:33

the problem is that sas remove the zero before each and every cust_comp_key for example ABC_000572 is converting to 572 but i want to keep the zeros before 572 ...
rsubmit;
data ca_m_service_2;
set ca_m_service;
num_compte = input(substr(CUST_COMP_KEY, 6),Best12.);
run;
endrsubmit;
Thanks,

Neeraj Kumar123
NewUser
NewUser
Posts: 1
Joined: 25 May 2016 08:40
Status: Offline

Re: How to add zeros

#2

Post by Neeraj Kumar123 » 25 May 2016 08:44

I suggest you use z#. formats to pad numbers with foremost zeros.
Please try:
num_compte = input(substr(CUST_COMP_KEY, 6),z8.);
Or this may be more intuitive:
data ca_m_service_2;
set ca_m_service;
format num_compte z8.;
num_compte = substr(CUST_COMP_KEY, 6);
run;

Answer Source: Intellipaat made me easier to solve this particular issue.

Post Reply

Return to “Active Directory”