Left justifying numbers

I need to have numbers show up on a map. Something like this:

Person Number: 12345

The number, however, is formatted as N10, and it shows up on the screen right justified. I’d like this to show up left justified, but I need to be careful I don’t loose any zero’s (i.e. 28390 can’t turn into 2836).

Any suggestions?

If you are writing an INPUT statement, just have INPUT #NUMBER (AD=L). On a map, you can specify numeric fields as either a string of zeroes or nines. The difference is left/right justification.

steve

Steve,

I need to experiment a little with this but how would that operate with specifying the EM to supress lead zeros if you use 0’s versus 9’s on the map.

Well I guess I have my answer from some admittedly limited experimenting. Putting an edit mask to suppress zeroes or add a negative sign seems to override the L and R.

Is there a way around this other than have alpha definition on the map and using MOVE EDITED and MOVE LEFT/RIGHT?

Hi Mick;

With AD=L, Z’s to suppress leading zeroes are redundant.

However, you are correct, EM with leftmost signs and a bunch of Z’s and AD=L basically ignores the AD=L.

Let me play a bit and see if I can come up with something.

steve

Hi Steve,

I’m not using any input statements. The value is retrieved from a database, moved into #NUMBER, which is presented in the map. Can I use (AD=L) with a move statement?

You can MOVE LEFT #numeric TO #alpha
where #alpha is either a different field or a REDEFINE of #numeric.
Then use #alpha on the Map

steve

If you are using a map, you are either have INPUT USING MAP XXX or WRITE USING FORM XXX. In either case, the (AD=L) is an attribute that is applied at the time of input or write. It cannot be used in a move statement; that is where MOVE LEFT as Steve suggests. On a map, you would specify the (AD=L) within the extended field editing screen, which in 3270 looks like this:

Fld #MAP-NUMBER                                                  Fmt N7
-------------------------------------------------------------------------------
AD= MILT'_'___     ZP=OFF      SG=OFF     HE= 'APMHSECP'___________   Rls 0    
NL= _____          CD= __      CV= ________________________________   Mod Data 
PM= __  DF=                    DY= ______________________________              
EM= __________________________ SB= ________________________________            
                                                                               
001   --010---+----+----+---030---+----+----+---050---+----+----+---070---+----

Note the AD=MILT’_'. Please refer to the Natural manual (http://techcommunity.softwareag.com/ecosystem/documentation/natural/) for the possible values of AD.

Jerome