Or, if you are sorting in a pipe, create a separate sort key and retain the 
original unmolested addresses.

Regards, 
Richard Schuh 

 

> -----Original Message-----
> From: The IBM z/VM Operating System 
> [mailto:IBMVM@LISTSERV.UARK.EDU] On Behalf Of Alan Altmark
> Sent: Tuesday, May 24, 2011 8:49 AM
> To: IBMVM@LISTSERV.UARK.EDU
> Subject: Re: Sort IP addresses
> 
> On Tuesday, 05/24/2011 at 11:30 EDT, Dave Jones 
> <d...@vsoft-software.com>
> wrote:
> > num1 = right(num1,3,'0')
> > num2 = right(num2,3,'0')
> > num3 = right(num3,3,'0')
> > num4 = right(num4,3,'0')
> > padded_IP_addr.i = num1 || '.' || num2 || '.' || num3 || '.' || num4
> 
> That's ok for an intermediate result for sorting, but dogma 
> requires that include "i" in there so that you can relate it 
> back to the original list. 
> A dotted-quad element with leading zeros is traditionally 
> interpreted as octal.
> 
> Alan Altmark
> 
> z/VM and Linux on System z Consultant
> IBM System Lab Services and Training
> ibm.com/systems/services/labservices
> office: 607.429.3323
> mobile; 607.321.7556
> alan_altm...@us.ibm.com
> IBM Endicott
> 

Reply via email to