× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




I just want to display it in the sequence they want to see it in, so that .12 comes before .119. I don't care how it's sorted in the database. I am using RPG but SQL is not an option as they don't have 5722-ST1.



I also need to be able to allow them to position on the xxx.xxx.xxx.xxx. I have never used qsort so I will check it out.

Date: Thu, 22 Oct 2009 14:51:22 -0500
From: midrange-l@xxxxxxxxxxxxxxxx
To: midrange-l@xxxxxxxxxxxx
Subject: Re: Sorting Question

When you say "sort a file", what do you mean, exactly? You mean you
want to physically sort the records in this sequence?

Or do you mean that you are writing code that reads the file, and you
want it to be read in this sequence?

Are you writing this code in RPG? RPG w/SQL? PHP? Java? Cobol?

I'm thinking along the same lines as what Brian suggested, i.e. use
qsort()... but then I thought, "well, he says he wants to sort a file,
not an array". So I don't know if the qsort() would work. Plus,
without knowing what language you're coding in, how do I know you can
use qsort?

Then I thought, "maybe an SQL UDF". But then, "maybe he's not using
SQL!" and "maybe a UDF would be too slow" and "maybe he wants to
physically sort the records, not just read in that sequence".

Perhaps I think too much.



Jon S wrote:

I have the need to sort a file of IP addresses on a display as if they had a leading zero. For example they want to see



192.44.208.119
192.44.208.12
192.44.208.120


to be sorted as



192.44.208.12
192.44.208.119
192.44.208.120


as if the .12 had a leading zero. This is a character field. Any suggestions? Thanks in advance.



Jon

_________________________________________________________________
Windows 7: It helps you do more. Explore Windows 7.
http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen3:102009

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


_________________________________________________________________
Windows 7: Simplify your PC. Learn more.
http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen1:102009

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.