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 to comapre two files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sumitmalik29
Warnings : 1

New User


Joined: 10 Feb 2008
Posts: 19
Location: bhuneswar

PostPosted: Thu Nov 12, 2009 12:20 am    Post subject: Icetool to comapre two files
Reply with quote

Hi

I need to comapre the two files from which

First file is like

021234555555
003448999999
223456777777
021234555555
345905111111
021234556755
023324443337

Requirement from above file is to
1) include records that start with 02 only
2) if there are duplicate record that starts with 02 then keep the single
(can be either first or last) record only.

I am using below control card (CTL1) for the above requiremnt but not getting result
P

//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(1,7,CH) NODUPS USING(CTL3) DISCARD(OUT1)
/*
//CTL1CNTL DD *
INCLUDE COND=(1,2,CH,EQ,C'02')
SORT FIELDS=(1,12,CH,A)
SUM FIELDS=NONE

kindly help

Thanks in advance
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: Thu Nov 12, 2009 12:36 am    Post subject:
Reply with quote

You've only shown/explained part of your requirement.

Please show an example of the records in each input file and what you expect for output. Explain the complete rules for comparing the two files. Give the RECFM and LRECL of each input file. Give the starting position, length and format of each relevant field in each input file.
Back to top
View user's profile Send private message
sumitmalik29
Warnings : 1

New User


Joined: 10 Feb 2008
Posts: 19
Location: bhuneswar

PostPosted: Thu Nov 12, 2009 11:28 am    Post subject:
Reply with quote

Hi Frank,

Below is my full requirement

Two files that are required to compare are

Fille 1
020001111111111AAA
120002222222222BBB
130003333333333CCC
020004444444444DDD
020004444444444EEE
340006666666666FFF
020004444444444GGG
020005555555555HHH
020005555555555III


File1 - contains policy numbers from columns 6 to 15
I have to include policy number for those records that start with '02' in cols 1 to 2

File 2
001111111111777
009999999999777
008888888888777
005555555555777
003333333333777
006666666666777
004444444444777
003333333333777
009999999999777
009999999999777

File2 - contains policy numbers from columns 3 to 12


Output Expected

009999999999777
008888888888777
006666666666777
003333333333777

file1 -> LRECL =18
file2 -> LRECL =15

I have to compare File1 and File2 on the basis of policy number,

If the policy number present in File2 is not matched with policy number in File1(for records that start with 02)
then policy number from file2 , needs to written to a third file.

If the file2 contains duplicate policy numbers that are not matching with file1 policy number,
then only one instance of policy number from file2 is to be written in third file,

Thanks in advance for your help.

Sumit
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Nov 13, 2009 1:47 am    Post subject: Reply to: Icetool to comapre two files
Reply with quote

sumitmalik29,

The following DFSORT/ICETOOL JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICETOOL                                         
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*                                             
//FB18     DD DSN=your FB 18 byte file,DISP=SHR
//FB15     DD DSN=your FB 15 byte file,DISP=SHR                         
//TEMP     DD DSN=&&TEMP,DISP=(MOD,PASS),SPACE=(CYL,(X,Y),RLSE)     
//OUT      DD SYSOUT=*                                             
//TOOLIN   DD *                                                     
  COPY FROM(FB18) USING(CTL1)                                       
  COPY FROM(FB15) USING(CTL2)                                       
  SORT FROM(TEMP) USING(CTL3)                                       
//CTL1CNTL DD *                                                     
  INCLUDE COND=(1,2,CH,EQ,C'02')                                   
  OUTFIL FNAMES=TEMP,BUILD=(3:6,10,3X,C'1')                         
//CTL2CNTL DD *                                                     
  OUTFIL FNAMES=TEMP,OVERLAY=(16:C'2')                             
//CTL3CNTL DD *                                                     
  SORT FIELDS=(3,10,CH,A),EQUALS                                   
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(18:SEQNUM,8,ZD,RESTART=(3,10))),
  IFTHEN=(WHEN=GROUP,BEGIN=(18,8,ZD,EQ,1),PUSH=(17:16,1))           
  OUTFIL FNAMES=OUT,INCLUDE=(16,2,ZD,EQ,22,AND,18,8,ZD,EQ,1),       
  BUILD=(1,15)                                                     
//*
Back to top
View user's profile Send private message
sumitmalik29
Warnings : 1

New User


Joined: 10 Feb 2008
Posts: 19
Location: bhuneswar

PostPosted: Fri Nov 13, 2009 4:24 pm    Post subject:
Reply with quote

Hi Skolusu I am getting below syntax error,



SORT FIELDS=(3,10,CH,A),EQUALS
OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(18:SEQNUM,8,ZD,RESTART=(3,10))),
IFTHEN=(WHEN=GROUP,BEGIN=(18,8,ZD,EQ,1),PUSH=(17:16,1))
*
OUTFIL FNAMES=OUT,INCLUDE=(16,2,ZD,EQ,22,AND,18,8,ZD,EQ,1),
BUILD=(1,15)
WER428I CALLER-PROVIDED IDENTIFIER IS "0003"
WER268A OUTREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

It seems that my system don't support, Group, Push Function.

Anyways, thanks for your time and help
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: Fri Nov 13, 2009 4:41 pm    Post subject:
Reply with quote

Why do you NOT check which sort product you are using before posting, or at least state which one it is icon_evil.gif

This is yet another case of people not doing their work before asking others to do it for them.

Your product is SYNCSORT NOT DFSORT

So someone has wasted time and effort on a solution that DOES NOT work because you could not be bothered to check which product is in use at your site.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Nov 13, 2009 8:36 pm    Post subject:
Reply with quote

Hello,

Quote:
It seems that my system don't support, Group, Push Function.
If your system was running the current release of Syncsort, WHEN=GROUP is available. Have your product upgraded. . .
Back to top
View user's profile Send private message
sumitmalik29
Warnings : 1

New User


Joined: 10 Feb 2008
Posts: 19
Location: bhuneswar

PostPosted: Sat Nov 14, 2009 1:03 am    Post subject:
Reply with quote

I do apologize for this and will take care that it won't happen in future

I am really thankful to Skolusu for his time and help.

Again sorry for inconvience caused

Regards
Sumit
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Nov 14, 2009 2:10 am    Post subject:
Reply with quote

Hello,

Quote:
Again sorry for inconvience caused
You weren't the first and surely won't be the last - it is one of our most re-curring themes icon_smile.gif
Now you know. . . icon_wink.gif

You might use the forum search and find some similar requests that have a pre-WHEN=GROUP solution.

Suggest that your system be upgraded as the current release has been available for quite a while now. . .
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 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