0

The short of it is, I am on a project converting this legacy IBM mainframe system, written mostly in COBOL and HLASM - I hit certain things that are beyond my knowledge as a .Net Developer.

I am replicating a table sorting procedure:

The inputs are a 'table' and a 'Sort Control Field'

The table is really just a array of characters represented as a BYTE(0 to 256).

The control field is the index of the control field.

Based on this control field i am supposed to sort it in EBCDIC ascended Collating Order.

What does it mean to sort on a control character in EBCDIC ascending collated sequence?

zarchasmpgmr
  • 1,422
  • 10
  • 21
Cody Popham
  • 992
  • 5
  • 14
  • Can you provide the structure itself? Are you going to be doing it on the Mainframe? In COBOL, HLASM or DFSORT? Or off the Mainframe? – Bill Woodger Mar 24 '17 at 11:58
  • I will be doing it in a windows environment - C# will be the language. – Cody Popham Mar 24 '17 at 18:52
  • The structure is a array of characters {H,G,T,1,U,O,W,P} – Cody Popham Mar 24 '17 at 18:56
  • 1
    I think you'll need to post the original code. The "index" may not be relevant. Is it just sorting the table into order? EBCDIC order is different than ASCII. A search-engine can find examples of combined EBCDIC/ASCII tables. – Bill Woodger Mar 24 '17 at 22:54
  • I have some documentation, not source code - but the gist of it is this line "The sort is made on a single control field located anywhere within the records/characters. The sorting is in ascending EBCDIC collating sequence." – Cody Popham Mar 24 '17 at 23:48
  • 1
    OK, that's unusual. I guess the "index" shows the location of the first byte (you know the length of the key). You'd need to extract all the keys from the table, along with a reference to the original table position. Then sort your extracted keys. Use that new table in sequence, to reference the items in the original table by the original reference to the table (which you've sorted along with the keys). If I've understood. There's nothing COBOL in this. I don't know C#. That's my best guess, but it's unusual, and difficult to verify without sample data. – Bill Woodger Mar 25 '17 at 10:54

0 Answers0