Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Can I do this using ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Feb 11, 2013 9:13 pm    Post subject: Can I do this using ICETOOL
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    Post subject: Reply to: Can I do this using ICETOOL
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: 8593
Location: Back in jolly old England

PostPosted: Tue Feb 12, 2013 1:51 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm
No new posts Icetool or Joinkeys example to compar... ishant chauhan DFSORT/ICETOOL 21 Sat Aug 20, 2016 2:40 am
No new posts ICETOOL higher option Anshul Das DFSORT/ICETOOL 14 Thu Apr 14, 2016 8:00 am
No new posts Compare Files and extract matching re... vimalravi83 DFSORT/ICETOOL 3 Wed Jan 06, 2016 2:42 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us