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
 

 

ICETOOL for Comparing two files with Header/Trailer records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: ICETOOL for Comparing two files with Header/Trailer records
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Sep 15, 2007 9:12 pm    Post subject:
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    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Sep 17, 2007 8:40 pm    Post subject:
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    Post subject: Reply to: ICETOOL for Comparing two files with Header/Traile
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Sep 19, 2007 8:29 pm    Post subject:
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    Post subject: Reply to: ICETOOL for Comparing two files with Header/Traile
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    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 Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm


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