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

ICETOOL for Comparing two files with Header/Trailer records


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

New User


Joined: 14 Sep 2007
Posts: 4
Location: pune

PostPosted: Sat Sep 15, 2007 8:24 pm
Reply with quote

Hi

1) I have 2 Input Files,Need to read these two input files Based on the commom key i.e CIDN (field) & if Field (CIDN) of File2 is not present in File1 then need to write File-2 records in to another file(FILE3)

2) Both contain three types of records

Header ,Trailer & Detail [detail-records or main-records "which need to
process"] Records.

3) Header records start with 0 (zero),main records start with 2 (two) and
Tailer records start with 9 in First Column.see below in example

4) There is Common Key (Field) in Both Input Files is (Customer Number)
i.e CIDN ,the KEY (Field )length is 10 (numeric) Which start from 2-10.

5) This KEY having same position in two files.

5) Length of first FILE1 is LRECL=38

6) Length of second FILE2 is LRECL=1098

Details of Input records :

File1input records

0Header
21234567890
23333333333
28888888888
9TRAILER

File2 Input records
0Header
21234567890
23333333333
25555555555
27777777777
9TRAILER

Expected Out put will be (following record is present in file2 but not in file1) in FILE-3 is

25555555555
27777777777

Need ICETOOL JOB for this logic

Thanks & best regards

Premparkash India
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: Sat Sep 15, 2007 9:12 pm
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=*
//IN1 DD DSN=... input file1 (FB/38)
//IN2 DD DSN=... input file2 (FB/1098)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT  DD DSN=...  output file (FB/1098)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(2,10,ZD) NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
  INCLUDE COND=(1,1,CH,EQ,C'2')
  INREC OVERLAY=(1099:C'1')
/*
//CTL2CNTL DD *
  INCLUDE COND=(1,1,CH,EQ,C'2')
  INREC OVERLAY=(1099:C'2')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(1099,1,CH,EQ,C'2'),
    BUILD=(1,1098)
/*
Back to top
View user's profile Send private message
prem_urs

New User


Joined: 14 Sep 2007
Posts: 4
Location: pune

PostPosted: Sun Sep 16, 2007 10:01 pm
Reply with quote

Hi Frank,

Thank you very much for your help.

1)I ran the Job and got the results,but some data getting truncated in out file from 1093 to 1098.

2) if i need to get Header & Traile also in OUT file with Main records what changes required in ICETOOL JOB.


Thanks,

Premparkash
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: Mon Sep 17, 2007 8:40 pm
Reply with quote

Quote:
1)I ran the Job and got the results,but some data getting truncated in out file from 1093 to 1098.


You mean positions 1093-1098 from some input records are not appearing in the output records or are blanks or what? The job I gave you would not do that. So you either changed the job in some way or gave me the wrong information about your input records. If you want me to help you figure out what's wrong, you'll need to give me more information so I can figure out what's different between my job and yours or between my input and yours.

Quote:
if i need to get Header & Traile also in OUT file with Main records what changes required in ICETOOL JOB.


Did you want the header and trailer from file2 in the output file, or did you want something else? You need to show me what you expect for output with the input you showed.
Back to top
View user's profile Send private message
prem_urs

New User


Joined: 14 Sep 2007
Posts: 4
Location: pune

PostPosted: Wed Sep 19, 2007 2:02 pm
Reply with quote

Hi Frank

i got proper out put only i need to add header and trailer as below in out put file

0Header
25555555555
27777777777
9TRAILER

thanks
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: Wed Sep 19, 2007 8:29 pm
Reply with quote

If that's what you want for the Header and Trailer, then just use this for CTL3CNTL:

Code:

//CTL3CNTL DD *                                         
  OUTFIL FNAMES=OUT,INCLUDE=(1099,1,CH,EQ,C'2'),       
    BUILD=(1,1098),                                     
    REMOVECC,HEADER1=('0Header'),TRAILER1=('9Trailer') 
Back to top
View user's profile Send private message
prem_urs

New User


Joined: 14 Sep 2007
Posts: 4
Location: pune

PostPosted: Thu Sep 27, 2007 2:30 pm
Reply with quote

Hi Frank,

Thank you very much !

its working fine,got the result


Thanks,

Premparkash
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
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
Search our Forums:

Back to Top