Have a look at the builtin ip2socka stage. After that you can sort. After
that you convert back with the reverse or strip the added key off.
On May 24, 2011 5:29 PM, "Dave Jones" wrote:
IPv4 addresses (the dotted decimal stuff) should be converted to
binary, one "octet" for each component. It's fixed at 32 bits total,
so you can sort that reliably.
Personally, I would rather convert it to hex and sort that, but ...
ahhh the joy of EBCDIC collating sequence. (Someone will jump i
-3179 (w)
(925) 323-2070 (c)
IM: VMBearDad (AIM), mbhcpcvt (Y!)
The IBM z/VM Operating System wrote on 05/24/2011
08:59:45 AM:
> From: "Schuh, Richard"
> To: IBMVM@LISTSERV.UARK.EDU
> Date: 05/24/2011 09:01 AM
> Subject: Re: Sort IP addresses
> Sent by: The IBM z/VM Ope
That's right, Alan.and I've been bitten by those leading '0's being
taken as numbers in octal.
DJ
On 05/24/2011 10:48 AM, Alan Altmark wrote:
> On Tuesday, 05/24/2011 at 11:30 EDT, Dave Jones
> wrote:
>> num1 = right(num1,3,'0')
>> num2 = right(num2,3,'0')
>> num3 = right(num3,3,'0')
>> num
y 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
>
> wrote:
> > num1 = right(num1,3,'0')
> > num2 = right(num2,3,'0')
> > num3 = right(num3,3,'0&
On Tuesday, 05/24/2011 at 11:30 EDT, Dave Jones
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 re
ld "pad 3 left 0" to make all octets 3
bytes long.
Regards,
Richard Schuh
> -Original Message-
> From: The IBM z/VM Operating System
> [mailto:IBMVM@LISTSERV.UARK.EDU] On Behalf Of Jim Bohnsack
> Sent: Tuesday, May 24, 2011 7:40 AM
> To: IBMVM@LISTSERV.UARK.EDU
> Su
Hi, Jim.
You might try something like this in Rexx (untested):
/*/
IP_addr.1 = '10.23.178.200'
IP_addr.2 = '192.168.128.12'
IP_addr.3 = '172.12.210.34'
IP_addr.0 = 3
do i = 1 to IP_addr.0
parse var IP_addr.i num1 '.' num2 '.' num3 ',' num4
num1 = right(num1,3,'0')
num2 = right(num2,3,'0
Does anyone have an xedit macro, or some other means, to sort a column
of ip addresses that will accommodate the varying number of digits
between the dots. I looked on the IBM download website, but don't see
anything.
Jim Bohnsack
--
James Bohnsack
(972) 596-6377 home/office
(972) 342-5823 c