It's probable DFSORT could do that too. Consider the value of IFTHEN and 
"ADD,+1" in OUTREC to increment and check the bounds of the block haven't 
been reached.

But I accept that might be a fetishistic approach: Turning everything into 
something to be solved by DFSORT.

Cheers, Martin

Martin Packer,
zChampion, Principal Systems Investigator,
Worldwide Banking Center of Excellence, IBM

+44-7802-245-584

email: martin_pac...@uk.ibm.com

Twitter / Facebook IDs: MartinPacker
Blog: 
https://www.ibm.com/developerworks/mydeveloperworks/blogs/MartinPacker



From:   "Sankaranarayanan, Vignesh" 
<vignesh.v.sankaranaraya...@marks-and-spencer.com>
To:     IBM-MAIN@listserv.ua.edu
Date:   16/04/2014 18:29
Subject:        Re: Sorting CSV data that begins with an IP address
Sent by:        IBM Mainframe Discussion List <IBM-MAIN@listserv.ua.edu>



Bernd,

The REXX processing after sort is not as much a transformation as it is a 
search for the next available value from an IP block.

- Vignesh
Mainframe admin

On Apr 16, 2014 6:24:08 PM, Bernd Oppolzer <bernd.oppol...@t-online.de> 
wrote:

If the data is processed by a REXX routine after the sort anyway,
why not do this transformation before the sort with another REXX routine?
Should be a piece of cake ...

Then the sort ...

and if the leading zeroes indeed need to be removed again, you can do this
in the REXX routine which runs after the sort.

If the file is not very large, even the sorting can be done by clever 
usage
of a REXX stem variable ... put the whole thing in a REXX stem, do all the
modifications and sorting there and put it out in the desired format and
order.
I've done this very often even on Windows, to get readable reports out of
unstructured test data ...

BTW: 35th birthday of REXX some days ago ... many thanks to Mike Cowlishaw 
!

Kind regards

Bernd



Am 16.04.2014 16:26, schrieb John Gilmore:
> This thread is giving me a bit of trouble.
>
> An IPA is internally a four-byte unsigned binary integer.  By
> convention it is formatted externally as a sequence of four unsigned
> decimal integers separated by dots and with 'insignificant' leading,
> leftmost  zeros suppressed.   Each byte can of course have a decimal
> value d in the open interval 0 <= d <= 255.  The IPA from which I am
> sending this is, for example,
>
> 24.62.42.175
>
> InN order to make it sortable lexicographically just one operation is
> required: any and all short, less that three-digit, byte values need
> to be padded out on the left to three digits with zeros.  For my IPA
> doing so yields
>
> 024.062.042.175
>
> This operation is doable, if need be, in RPG; and it is of course
> doable in any adult programming language, readily for example in
> COBOL.
>
> Why all the pother?
>
> John Gilmore, Ashland, MA 01721 - USA
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

MARKSANDSPENCER.COM
________________________________
 Unless otherwise stated above:
Marks and Spencer plc
Registered Office:
Waterside House
35 North Wharf Road
London
W2 1NW

Registered No. 214436 in England and Wales.

Telephone (020) 7935 4422
Facsimile (020) 7487 2670

www.marksandspencer.com

Please note that electronic mail may be monitored.

This e-mail is confidential. If you received it by mistake, please let us 
know and then delete it from your system; you should not copy, disclose, 
or distribute its contents to anyone nor act in reliance on this e-mail, 
as this is prohibited and may be unlawful.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN



Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to