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

Report Formatting using SORT/ICETOOL


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

New User


Joined: 19 Feb 2011
Posts: 2
Location: CHENNAI

PostPosted: Sat Feb 19, 2011 3:01 pm
Reply with quote

Hi,

Please let me know how to make the following report using ICETOOL/SORT

My Input file:

101 N data1
205 Y data2
307 N data3
101 Y data4
309 N data5
205 Y data6
307 N data7
119 Y data8
101 N data9

Here the first three character field is transaction numbers ,'N' and 'Y' represents transaction types and rest of the data vary from each record to record.

I need to report like below:

Section 1( should look like below)
101 N data1
307 N data3
309 N data5
307 N data7
101 N data9

section 2
205 Y data2
101 Y data4
205 Y data6
119 Y data8

summary section

TRANSACTION TYPE NUMBER
----------------- ------- ----------
101 N 2
307 N 2
309 N 1
205 Y 2
101 Y 1
119 Y 1


Thanks,
K
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: Tue Feb 22, 2011 2:13 am
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
101  N   data1
205  Y   data2
307  N   data3
101  Y   data4
309  N   data5
205  Y   data6
307  N   data7
119  Y   data8
101  N   data9
/*
//**>  OUT MUST BE A MOD DATA SET
//OUT DD DISP=MOD,DSN=...  output file (FB/80)
//TOOLIN DD *
SORT FROM(IN) TO(OUT) USING(CTL1)
SORT FROM(IN) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  OPTION EQUALS
  INREC IFTHEN=(WHEN=(6,1,CH,EQ,C'N'),
     OVERLAY=(81:SEQNUM,8,ZD,89:C'1')),
        IFTHEN=(WHEN=(6,1,CH,EQ,C'Y'),
     OVERLAY=(81:SEQNUM,8,ZD,89:C'2'))
  SORT FIELDS=(6,1,CH,A,81,8,ZD,A)
  OUTFIL REMOVECC,
    BUILD=(1,80),
    SECTIONS=(6,1,HEADER3=(/,'Section ',89,1))
/*
//CTL2CNTL DD *
  SORT FIELDS=(6,1,CH,A,1,3,CH,A)
  OUTFIL REMOVECC,NODETAIL,
    HEADER2=(/,'summary section',/,X,/,
     'TRANSACTION        TYPE    NUMBER',/,
     '-----------------  ------- ----------'),
    SECTIONS=(1,6,
      TRAILER3=(1,3,20:6,1,28:COUNT=(M10,LENGTH=10)))
/*
Back to top
View user's profile Send private message
Kothai sentha

New User


Joined: 19 Feb 2011
Posts: 2
Location: CHENNAI

PostPosted: Thu Feb 24, 2011 8:46 am
Reply with quote

It worked, Thanks a lot Frank..
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 How to split large record length file... DFSORT/ICETOOL 7
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
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
Search our Forums:

Back to Top