View previous topic :: View next topic |
Author |
Message |
misi01 Advanced
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
|
Posted: Thu Sep 13, 2018 6:17 am Post subject: SORT a working-storage table within a CICS transaction |
|
|
I'm really confused about this, since some googling seems to give the impression that you can sort, whereas other seems to give the impression that you have to sort based on the "usual" perform looping through the table in your WS.
I'm tempted to say that my requirements are a bit more complicated than the usual examples you find on the net inasmuch as I need to sort a table on two columns; first on ascending car registration number, and within that, descending claims' date.
I have cobbled together reasonably generalized code and can paste it in a separate append to this, but what I really wanted to do was use the SORT verb. I found references to the 'format 2' but
couldn't get it to work
got the impression it could only be used to sort one column
couldn't find any example of how to code it
Basically, the code I wrote was as follows (skipping all the superfluous code)
Code: |
FILE-CONTROL.
*
select sort-file assign to sortfil1.
*
DATA DIVISION.
*
FILE SECTION.
*
sd sort-file
record contains 36 characters
data record sort-record.
01 sort-record.
05 sort-key.
10 sort-regnr pic x(6).
10 sort-skadedatum pic x(6).
10 sort-vsg-fnum pic 9(8).
10 sort-skrot-skadenummer
pic x(16).
etc etc
*
sort sort-file
on ascending key sort-regnr
descending key sort-skadedatum
input procedure bba-sort-input
output procedure bbb-sort-output.
|
This worked fine in an ordinary batch program, but in an online one, it crashed.
Is this even doable (or am I simply doing it wrong) ???? _________________ Michael |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
misi01 Advanced
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
|
Posted: Thu Sep 13, 2018 11:50 pm Post subject: |
|
|
Does that mean that CEE3SRT has to be called from an assembler program?
Or can I simply call it using something along the lines of
Code: |
Call 'CEE3SRT' using mygroup, w-rc
|
where mygroup contains seven zeroes and a -1.
If that's the case (and since we don't need/intend to use any exits), how would the individual zeroes be defined, 9(4) comp or ....? _________________ Michael |
|
Back to top |
|
|
|
|