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

Can I do this using ICETOOL


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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Feb 11, 2013 9:13 pm
Reply with quote

PTF Level, ICE020I = H

I have an input file as shown below, RECFM=FB, LRECL=40, and what I want to do is to select records from only GRP2 and propogate the GRP and NAME from the first record in each subset of records down to all the other records in the subset, as shown in the desired output.

I've read through the DFSORT smart tricks document and user guide, and will gladly admit that I know very little about the functionality of DFSORT / ICETOOL other than the basics.

Anyone have any ideas on how to achieve this.

Input data
Code:

GRP1 NAME1  DATE1
            DATE2

GRP1 NAME2  DATE1

GRP1 NAME3  DATE1
            DATE2
            DATE3

GRP2 NAME1  DATE1
            DATE2

GRP2 NAME2  DATE1
            DATE2
            DATE3
            DATE4

GRP3 NAME1  DATE1
            DATE2

GRP3 NAME2  DATE1


Required output
Code:

GRP2 NAME1  DATE1
GRP2 NAME1  DATE2
GRP2 NAME2  DATE1
GRP2 NAME2  DATE2
GRP2 NAME2  DATE3
GRP2 NAME2  DATE4
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Feb 11, 2013 10:30 pm
Reply with quote

expat,

It is quite easy, all you need to do is use WHEN=GROUP. Use the following DFSORT JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                                 
----+----1----+----2----+----3----+----4----+----5----+----6----
GRP1 NAME1  DATE1                                               
            DATE2                                               
GRP1 NAME2  DATE1                                               
GRP1 NAME3  DATE1                                               
            DATE2                                               
            DATE3                                               
GRP2 NAME1  DATE1                                               
            DATE2                                               
GRP2 NAME2  DATE1                                               
            DATE2                                               
            DATE3                                               
            DATE4                                               
GRP3 NAME1  DATE1                                               
            DATE2                                               
GRP3 NAME2  DATE1                                               
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  OPTION COPY                                                   
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,NE,C' '),PUSH=(1:1,10))
  OUTFIL INCLUDE=(1,4,CH,EQ,C'GRP2')                           
//*
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Feb 12, 2013 1:51 pm
Reply with quote

Thanks Kolusu,

I was sort of going in the right direction by using INREC. Many thanks for the solution.
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 ICETOOL to Read records SMF CEF it is... DFSORT/ICETOOL 4
Search our Forums:

Back to Top