That returns data sorted alphabetically (1, 10, 2, 3, etc).
I have done searches on previous topics and found nothing like this (lots on sorting, but none for numeric keys). Ideally, I would like to avoid having to use a separate job with a sort stage to a sequential file (which is the only way I know) as this is a transform routine to be reused.
EXECUTE \SSELECT yourhashfile BY yourkeycolumn FMT "12R"\
Your primary key column must be showing as a left justified field in the hash file dictionary. Override this format using the FMT keyword when you execute the select. You cannot use a BASIC select, you must switch to an EXECUTE or PERFORM.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
In fact, there's a wealth of information here for anyone who wants to dive into Universe BASIC full time.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
I am looking at the web pages you posted the address of now. But so you know, I did actually have it exactly as you put it in (with no quotes - apart from those you specify). It just seems to parse it that way.
I assumed that the 'yourhashfile' part of your code refered to a file variable. I have found that it refered to the actual name (a mistake on my part - but that was how it worked in the select without the execute). I had an OPEN statement above and assumed that this operated on the open hashfile referenced by the LOG file var.
If you want the SSELECT filevariable statement to perform a numeric sort of the keys, change the definition of @ID in the file dictionary so that it is right-justified rather than left justified. For example: