Hi All,
i need a Routine for my server job (7.5.2)
here is the requirement :"Convert the (23, 3) number into 16 position character. Left pad with ZERO's and Keep the sign if it is required. "
could you help me how to wright routine for this one.
Thanks
Chandu
Routine_for trimming and sign assign
Moderators: chulett, rschirm, roy
Re: Routine_for trimming and sign assign
You should be able to achieve what you want with this derivation -
It won't work if the input value has a length in excess of 16.
Code: Select all
If Arg1 < 0 Then '-':Fmt(Field(Arg1,'-',2), "15'0'R") Else Fmt(Arg1, "16'0'R")
gateleys
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
But does if you truncate Arg1. Let stage variable svArg1 be defined as Right(Arg1,16).
Code: Select all
If svArg1 < 0 Then '-':Fmt(Field(svArg1,'-',2), "R%15") Else Fmt(svArg1, "R%16")
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.