I handle this whole process differently.
I begin by clearing a variable using SFIL to set it to the appropriate
length of spaces.
I then use SPUT to insert the non-blank parts in their places.
SET VAR dollar TEXT = ('99,999,990.00')
SET VAR vline = (SFIL(' ', .vfaright)) -- vfaright is like 80 or
132 depending
SET VAR vtemp = (FORMAT(.vt2, .dollar)) -- formatting amount in text
variable vtemp
--right justified at .vright
SET VAR vline = (SPUT(.vline, .vtemp, .vright - SLEN(.vtemp)-.lpct))
Since I do this a lot, I have created command files (.sub files)
to perform the common tasks. Like below:
RUN clearlin.sub -- clears the line
RUN place.sub USING 'PO#:', 'R', 17 -- puts the text PO# Right
adjusted at column 17
RUN place.sub USING .vponum, 'L', 19 -- puts the text in vponum
left adjusted at column 19
RUN writeclr.sub -- writes the line and clears
it
But essentially still just SPUT's.