cancel
Showing results for 
Search instead for 
Did you mean: 

Zeros padding

Former Member
0 Kudos

Hi there,

PowerDesigner Help tells '-n' format switch 'extracts the last n characters. Blanks or zeros are added to the right to fill the width and justify the output to the left'.

I need to left-zeros-pad the variable REFRNO. But for now I can only blanks pad with this syntax: %-2.2:REFRNO%

Do you know where and what is the switch to force zeros padding instead of blanks padding?  The help is not clear about that.

Many thanks,
Daniel

Accepted Solutions (1)

Accepted Solutions (1)

marc_ledier
Active Participant
0 Kudos

Hi,

This must be an error in documentation, only spaces are added to pad a variable.

In an other hand, you could define a template (in a copy of the xdb so that it is recognise in DBMS.Script category) this way

At <YourDBMS>::Profile\Reference\, create new templates "myRefrNo" containing

<<

.set_value(expected, "0000000000%REFRNO%", new)

%.-5:expected%

>>

=> this gives you a new "variable" myRefrNo equal to 5digit length REFRNO, that you can use in the script part (in reference category) of your DBMS.

Marc

Former Member
0 Kudos

Many thanks Marc.

Answers (0)