Keep Leading Zeroes in Character Field

Jones Allen (Van) Allen.Jones@vpgroup.com
Thu, 5 Apr 2001 13:20:07 -0700


Please send the QSHOW listing of the file you're trying to link to.  Is the
key a character field that contains only numbers or is it defined as a
numeric type, such as "integer"?  If it's CHARACTER link to it as follows:

using QUIZ:
  access file_1 link (ascii(field_1 of file_1,8)) to key of file_2

or QTP:
  access file_1 link ascii(field_1 of file_1,8) to key of file_2

If it's a numeric type (integer, packed, etc) you may be seeing the leading
zeroes only because of the output format, significance, etc defined for the
key item in the dictionary.  In that case, do the following:

using QUIZ or QTP:
  access file_1 link field_1 of file_1 to key of file_2

Hope this helps.


-----Original Message-----
From: joann.l.olsen@us.abb.com [mailto:joann.l.olsen@us.abb.com]
Sent: Thursday, April 05, 2001 12:26 PM
To: powerh-l@lists.swau.edu
Subject: Keep Leading Zeroes in Character Field




Thanks to everyone for the help.  I needed the leading zeroes for linking to
another file where the key in that file is numeric and contains the leading
zeroes.  I tend to agree with Bob Edis.  It can't be done.  Back to the
drawing
board!

This did not produce an error, but did not give me leading zeroes:

def d-num num*8 significance 8 pic "^^^^^^^^"  = nconvert(gbsbl)

On the following define, I got an error pointing to the comma.      def
d-num
num*8 = nconvert(gbsbl,8)


Original message:

I need to convert a character field to a numeric field, but keep the leading
zeroes.  If the nconvert is used, it drops the leading zeroes.  How can that
be
accomplished?  We are on an AS/400.

Example:  subledger  char*8 = 00100241
                     def D-NUM num*8 = nconvert(subledger)

The results in D-NUM is 100241

Thanks



= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe" in message body to
powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.