MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SORT a working-storage table within a CICS transaction

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware
View previous topic :: View next topic  
Author Message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Thu Sep 13, 2018 6:17 am    Post subject: SORT a working-storage table within a CICS transaction Reply with quote

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
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu Sep 13, 2018 3:05 pm    Post subject: Reply with quote

misi01,

DFSORT is not supported running under CICS which is explained here

https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/tasks/tpsor30.html

Instead you need to use the Language environment callable service CEE3SRT which would call DFSORT under the covers using the extended parameter list

https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.3.0/com.ibm.zos.v2r3.ceev100/callsrt.htm
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Thu Sep 13, 2018 11:50 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group