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

Merge two reports using ICETOOL


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

New User


Joined: 06 Jul 2007
Posts: 10
Location: Chentrappinni

PostPosted: Thu Jul 19, 2007 4:36 pm
Reply with quote

Hi all,

I have two files, each with one header, details and one trailer.

File1
----
Hed1
det1
det2
det3
tra1

File2
----
Hed1
det4
det5
det6
tra1

I need to create a sort out file as
Hed1
det1
det2
det3
det4
det5
det6
tra1

First 2 chars of header is X'00' and for trailer is X'FF'.

Thanks is advance
Dingu
Back to top
View user's profile Send private message
Dingu

New User


Joined: 06 Jul 2007
Posts: 10
Location: Chentrappinni

PostPosted: Thu Jul 19, 2007 4:39 pm
Reply with quote

This needs to be done with sort as there are no other utlities like ICETOOL etc.. icon_cry.gif
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu Jul 19, 2007 4:41 pm
Reply with quote

Quote:
This needs to be done with sort as there are no other utlities like ICETOOL etc..

Sure?
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 Jul 19, 2007 8:33 pm
Reply with quote

Here's a DFSORT job that will do what I think you asked for. I assumed your input files have RECFM=FB and LRECL=80, but you can change the job appropriately for other attributes. I assumed when you said "First 2 chars of header is X'00' and for trailer is X'FF'" you meant "first character" but if it's really X'0000' and X'FFFF', change the job accordingly. I assumed that you don't care which header or trailer we keep - the job actually keeps the header from input file1 and the trailer from input file2.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=... input file1 (FB/80)
//       DD DSN=... input file2 (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'1')),
    IFTHEN=(WHEN=(1,1,BI,EQ,X'00'),
      OVERLAY=(81:SEQNUM,1,ZD)),
    IFTHEN=(WHEN=(1,1,BI,EQ,X'FF'),
      OVERLAY=(81:SEQNUM,1,ZD))
  OUTFIL OMIT=((1,1,BI,EQ,X'00',AND,81,1,ZD,EQ,+2),OR,
               (1,1,BI,EQ,X'FF',AND,81,1,ZD,EQ,+1)),
         BUILD=(1,80)
/*
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 Jul 19, 2007 8:34 pm
Reply with quote

Quote:
This needs to be done with sort as there are no other utlities like ICETOOL etc.


If you have DFSORT, you have DFSORT's ICETOOL.
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 Merge two VSAM KSDS files into third ... JCL & VSAM 6
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
Search our Forums:

Back to Top