On 10/11/11 20:52, Al DeWitt wrote:
I'm am trying to help out my users by helping them make sense of what they have 
done to themselves.  The field in question, Bin Number, is alphanumeric.  About 
three quarters of the entries are all numeric and one quarter are alphanumeric. 
 Below is a perfect example of my issue.



LIST INVWHS "27814*001" F1 F2 F3 12:43:18 NOV 10 2011 1

CPN*WH     Qty On Hand Shipping Qty Bin Number



27814*001  158         0            70300

                                     SO76127



My users want all the numeric sorted from lowest value to highest value as if 
the field was actually numeric.  My thought was to add to V-desc fields.  One 
that determines if the value is numeric or not (ALD.NUM.BIN)  and the other is 
the length of the field(ALD.BIN.LN).  This would sort based on the length of 
the value.  The greater the length the greater the value.  So the 10001 should 
print after 9999 and not in the vicinity of 1000 as it's doing now.



My first question is:  How do I make ALD.NUM.BIN report the condition of both 
values.  As you can see below it only shows the first value.  I'm thinking I 
need a -SUBR statement but can't find a list of them in the Unidata manuals.

I think you're tackling this all wrong. Let's create a field ALD.BIN which is fixed width (let's pick 10) padded with spaces, and justifies numeric to the right, alphanumeric to the left. The following i-descriptor code is for a single-value field, but you should be able to pull the same stunt for multi-value using the iirc IFS function?

0002: IF NUM(BIN) THEN FMT(BIN,"10R") ELSE FMT(BIN,"10L")

Or if you can't work that out, it's trivial to write a SUBR to do it :-)


LIST INVWHS "27814*001" F3 ALD.NUM.BIN ALD.BIN.LN 12:45:51 NOV 10 2011 1

CPN*WH     Bin Number Num Bin Bin Ln



27814*001  70300            1      5

            SO76127                 7



Here is the dictionary item (it was built using System Builder):



Top of "ALD.NUM.BIN" in "DICT INVWHS", 9 lines, 215 characters.

001: I

002: SUBR("SB.SMART.QUERY",'MK':@FM:'E;@1;C3;@6;X;Z#;I2;C1;J1;C0',@ID,@RECORD,@F

ILE.NAME,@NV)

003:

004: Num Bin

005: 1R

006: MV

007:



Assuming everything works correctly I need to modify my select statement:

Before I change:

SELECT INVWHS WITH WHS = "001" BY.EXP BIN

Followed up with READNEXT CPN.WHS,BIN.LOCATION



After I change my select to:

SELECT INVWHS WITH WHS = "001" BY.EXP ALD.NUM.BIN BY.EXP ALD.BIN.LN BY.EXP BIN

I don't get this ... if I understand correctly, all you want to do is change the order in which things are selected. So instead of doing a select BY.EXP BIN, you just change that to BY.EXP ALD.BIN, and then the order of your select statement will change, but not the values in it.

Cheers,
Wol
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to