Focal Point
MVS 7.1.1 sort

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3121048141

December 08, 2005, 12:19 PM
David Sibert
MVS 7.1.1 sort
I need to sort the data in the following way:

1ABL099
ABC1099

I do not want to do it the hard way of placing either a 0 or 1 in front of each character then sorting.

Does anyone have another idea?

Thanks,


dksib
DC Tech Services Inc
WF 8.2.1M
December 08, 2005, 03:08 PM
<RickW>
How about defining a new field by converting the alpha to hex and sorting by the hex field. UFMT function does that but not sure if that's on the mainframe.
December 11, 2005, 02:44 AM
Piipster
Hi David... In your example is it the numbers before letters that you are trying to do? Or, is it ABL before ABC?

For sorting in MVS and VM the sequence is a-z, A-Z, 0-9 for alphanumeric fields;
0-9 for numeric fields. In UNIX® and Windows NT® the sequence is 0-9, A-Z, a-z for
alphanumeric fields; 0-9 for numeric.

It's basically the difference between EBCDIC and ASCII.

You don't have much choice. Either create a new field to sort on or use BY fldname ROWS value over value.


ttfn, kp


Access to most releases from R52x, on multiple platforms.
December 12, 2005, 12:04 PM
David Briars
Hi David,

Try sorting using SyncSort, after creating your file in FOCUS.

SyncSort can convert your text from EBCDIC to ASCII, before sorting.

You will need to use the 'AC' data format, in your sort card.

For example, the following code and data file:

 //S1  EXEC SORT
 //SORT10.SYSIN   DD *
   SORT FIELDS=(1,07,AC,A)
 /*
 //SORT10.SORTIN  DD *
 1ABL099
 ABC1099
 2ABL099
 BBC1099
 /*
 //SORT10.SORTOUT DD SYSOUT=*  


Yields the following output:

  
 1ABL099
 2ABL099
 ABC1099
 BBC1099


Regards,
Dave




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
December 12, 2005, 05:38 PM
Mikel
A little trick... Custom sort using FML:

-* Field definition for testing purposes.
DEFINE FILE CAR
  MYFIELD/A10 = DECODE COUNTRY (
      'ENGLAND'   'ABC1099'
      'FRANCE'    '1ABL099'
      'ITALY'     'ZQWERTY'
      'JAPAN'     'ASDFG'
      'W GERMANY' '0ASDF'
    ELSE 'XXX') ;
END

-* Report.
TABLE FILE CAR
  SUM SALES

-* Custom sort.
  FOR MYFIELD NOPRINT
    '0' TO '9999999999' WHEN EXISTS OVER
    'A' TO 'ZZZZZZZZZZ' WHEN EXISTS

  BY MYFIELD
END


Regards,
Mikel


WebFOCUS 8.1.05, 8.2.01
January 24, 2006, 10:49 AM
Tim J
Hello:

I have a problem that may be along these same lines:

I have a report initially displayed by part number. The part number displays sorted by:
a-z
A-Z
0-9

I added column sorts so the user can sort any column, including the part number field if they want to go back to the report sorted by part number. But using the column sorts, orders the report:
0-9
A-Z
a-z

and doesn't match the original display. I'm not sure why, since the report just reruns itself using the opposite of what was ran previously (HIGHEST or LOWEST). This way, re-clicking a column will sort the column in opposite order.

How can I get the original display to equal the column sorts or vice versa?
Will using the tips above accomplish this as well?

Thanks,
Tim
January 25, 2006, 11:11 AM
ET
The original report appears to be a sort using an EBCDIC character set most likely from an IBM mainframe. The data is first sorted and then downloaded and converted to an ASCII character set. Resorting is now being done on the ASCII character set. Numbers are first with ASCII and are last with EBCDIC.


FOCUS 7.6 MVS PDF,HTML,EXCEL
January 25, 2006, 11:35 AM
Tim J
ET:

Thank you for the response. This is exactly what happened. I added a sort on Part Number to my HOLD file, so it gets sorted before I do my report. This gives me a uniform sort now and didn't seem to affect my performance at all.

Thanks,
Tim