IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Exit routines in ICETOOL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dhanasugumar

New User


Joined: 08 Apr 2010
Posts: 6
Location: India

PostPosted: Thu Apr 08, 2010 6:36 pm
Reply with quote

Hi,

Is it possible to invoke an E35/E15 exit routines in ICETOOL as we do in SORT.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Apr 08, 2010 8:07 pm
Reply with quote

Good first question, but why are you asking?
I'm wondering what sort of record changing you need that can't be done with the provided facilities?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Apr 08, 2010 9:39 pm
Reply with quote

Quote:
Is it possible to invoke an E35/E15 exit routines in ICETOOL as we do in SORT.


You can use E15 and E35 exits with the SORT and COPY operators of DFSORT's ICETOOL. For other operators, it depends.

You need to give a clearer explanation of what you're trying to do and why you need exits to do it.
Back to top
View user's profile Send private message
dhanasugumar

New User


Joined: 08 Apr 2010
Posts: 6
Location: India

PostPosted: Fri Apr 09, 2010 10:59 am
Reply with quote

Scenario: Am creating two outputs from a single sort in. The input has a control record and I want a control record to be created in both the sort outs. When I use E35 to execute my routine, its not creating a new control in the output.

But the same routine in E35 is creating a control record as expected when there is ONE sortout.

Below is the SYSIN I used.

Code:
SORT FIELDS=(1,7,CH,A), 
SIZE=E99999999,DYNALLOC=(SYSDA,32)                   
MODS E35=(crcntl,100,MODLIB,N)                     
OUTFIL FILES=1,                                       
OMIT=((1,1,CH,EQ,C'T',OR,                         
       1,1,CH,EQ,C'P'),AND,31,2,CH,EQ,C'01')       
OUTFIL FILES=2,                                       
INCLUDE=((1,1,CH,EQ,C'T',OR,                     
           1,1,CH,EQ,C'P'),AND,31,2,CH,EQ,C'01')
Back to top
View user's profile Send private message
dhanasugumar

New User


Joined: 08 Apr 2010
Posts: 6
Location: India

PostPosted: Fri Apr 09, 2010 5:16 pm
Reply with quote

My original file has 12 amount fields in it. Control record has record count and SUM of Amount (irrespective of the values of other fields) in it.
Ex:
rec1abc 100
rec2cde 200
rec3efg 100
rec4ghi 200

Control record should be
4 600
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Apr 09, 2010 9:25 pm
Reply with quote

You're not explaining clearly what you want to do or what is happening exactly, so it's difficult to help you. Your original question was about exits in ICETOOL, but all you show is DFSORT control statements, so I don't know what, if any, ICETOOL operator you're using.

You haven't explained clearly what you're trying to do. I don't know what your E35 exit does or if you even need it.

I don't know if you're using OUTFIL statements in one case and no OUTFIL statements in the other case, or if you're using OUTFIL statements in both cases.

If you explain things more clearly, I can probably help you. Showing your complete job, messages, input and expected output, etc would help.
Back to top
View user's profile Send private message
dhanasugumar

New User


Joined: 08 Apr 2010
Posts: 6
Location: India

PostPosted: Mon Apr 12, 2010 3:37 pm
Reply with quote

Hi Frank,

Sorry for the unclear request.

Currently I have been using SORT and exit E35 to create a control record in the output file. I have a batchcob(CRCNTL) written to create a control record with record count and sum of fields.
Input file:
rec1abc 100 220
rec2cde 200 120
rec3abc 100 200
rec4abc 100 456
rec5ghi 200 345
000005 700 1341

When i use the below sysin, my exit does create the control record as shown below and that is what is expected.

SORT FIELDS=(5,3,CH,A),
SIZE=E99999999,DYNALLOC=(SYSDA,32)
MODS E35=(crcntl,100,MODLIB,N)
INCLUDE COND=(5,3,CH,EQ,C'ABC')

Output file is:
rec1abc 100 220
rec3abc 100 200
rec4abc 100 456
000003 300 876

When i try creating two output files from a sortin, control record is not getting created. I have used the below code. (I believe the exit routine is not getting executed in the below code)

SORT FIELDS=(5,3,CH,A),
SIZE=E99999999,DYNALLOC=(SYSDA,32)
MODS E35=(crcntl,100,MODLIB,N)
OUTFIL FILES=1,
INCLUDE =(5,3,CH,EQ,C'ABC')
OUTFIL FILES=2,
OMIT=(5,3,CH,EQ,C'ABC')

Outfile1:
rec1abc 100 220
rec3abc 100 200
rec4abc 100 456

000003 300 876 - this control is not getting created in the final output file1

Outfile2:
rec2cde 200 120
rec5ghi 200 345

000002 400 465 - this control is not getting created in the final output file2

Since i did not get the expected result using SORT, I thought of trying with ICETOOL. Is there any possibilitis of creating the control record as shown above using SORT or ICETOOL. (My original file has around 25 such fields to be summed up in the control record)
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Apr 12, 2010 4:02 pm
Reply with quote

I really don't think that you need an exit for this, generating totals in a trailer record is a basic sort function and doing it for two outputs is as simple as doing it for one.

Take a look at Record Count and Sum Amount for each type of data for a starting point.
Back to top
View user's profile Send private message
dhanasugumar

New User


Joined: 08 Apr 2010
Posts: 6
Location: India

PostPosted: Mon Apr 12, 2010 6:48 pm
Reply with quote

I have to create two sortouts and they both have different INCLUDE/OMIT condition. Can you give some details on how to use trailer in this situation?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Apr 12, 2010 9:24 pm
Reply with quote

dhanasugumar,

The following DFSORT JCL will split the input file into 2 files and give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD *                                             
----+----1----+----2----+----3----+----4----+----5----+----6-
REC1ABC 100 220                                             
REC2CDE 200 120                                             
REC3ABC 100 200                                             
REC4ABC 100 456                                             
REC5GHI 200 345                                             
000005 700 1341                                             
//OUTABC   DD SYSOUT=*                                       
//OUTXXX   DD SYSOUT=*                                       
//SYSIN    DD *                                             
  OMIT COND=(1,1,ZD,EQ,0)                                   
  SORT FIELDS=(5,3,CH,A),EQUALS                             
                                                             
  OUTFIL FNAMES=OUTABC,REMOVECC,INCLUDE=(5,3,CH,EQ,C'ABC'), 
  TRAILER1=(COUNT=(M11,LENGTH=6),X,                         
            TOT=(9,3,ZD,M11,LENGTH=6),X,                     
            TOT=(13,3,ZD,M11,LENGTH=6))                     
                                                             
  OUTFIL FNAMES=OUTXXX,SAVE,REMOVECC,                       
  TRAILER1=(COUNT=(M11,LENGTH=6),X,                         
            TOT=(9,3,ZD,M11,LENGTH=6),X,                     
            TOT=(13,3,ZD,M11,LENGTH=6))                     
//*


OUTABC will have
Code:

REC1ABC 100 220       
REC3ABC 100 200       
REC4ABC 100 456       
000003 000300 000876 


OUTXXX will have

Code:

REC2CDE 200 120     
REC5GHI 200 345     
000002 000400 000465


CICS guy ,

I think OP wanted to split the input into 2 files and then perform the report writing.
Back to top
View user's profile Send private message
dhanasugumar

New User


Joined: 08 Apr 2010
Posts: 6
Location: India

PostPosted: Thu Apr 15, 2010 5:14 pm
Reply with quote

Hi Skolusu,

Thanks for your response. It worked for me the way I want.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Use of Perform Thru Exit COBOL Programming 6
Search our Forums:

Back to Top