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

DFSORT/ICETOOL - how to get the unique records of a file.


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

New User


Joined: 19 Mar 2008
Posts: 10
Location: Noida

PostPosted: Tue May 27, 2008 12:13 pm
Reply with quote

Hi All,

Input File A:
AAAAAAAAAAAAAA
BBBBBBBBBBBBBBB
CCCCCCCCCCCCC

Input File B:
CCCCCCCCCCCCC
BBBBBBBBBBBBBBB
DDDDDDDDDDDDD

Output File
AAAAAAAAAAAAAA
DDDDDDDDDDDDD

Considering the files as FB and length of the files be 80 bytes.

Please let me know the best option and tool to be used for this along with the Syntax of it.

Regards,
Smita
Back to top
View user's profile Send private message
HappySrinu

Active User


Joined: 22 Jan 2008
Posts: 194
Location: India

PostPosted: Tue May 27, 2008 12:16 pm
Reply with quote

Use the PGM=SORT and input cards as Sort field = ...... and SUM FIELDS=NONE to get unique records.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue May 27, 2008 1:47 pm
Reply with quote

Hi Srini,
the SUM FIELDS=NONE will not give the output that was requested.

It wiil delete duplicate records only, giving output as
AAAs
BBBs
CCCs
DDDs

Gerry
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue May 27, 2008 2:04 pm
Reply with quote

Hi Smita,

can File A contain duplicate records ?

can File B contain duplicate records ?


If no duplicates in either file you can try the following code
Code:
//S1       EXEC  PGM=ICETOOL                     
//TOOLMSG  DD SYSOUT=*                           
//DFSMSG   DD SYSOUT=*                           
//IN1      DD *                                   
AAAAAAAAAAAAAA                                   
BBBBBBBBBBBBBBB                                   
CCCCCCCCCCCCC                                     
CCCCCCCCCCCCC                                     
BBBBBBBBBBBBBBB                                   
DDDDDDDDDDDDD                                     
//OUT      DD SYSOUT=*                           
//TOOLIN   DD    *                               
SELECT FROM(IN1) TO(OUT) ON(1,15,CH) NODUPS       


Gerry
Back to top
View user's profile Send private message
Smita Pattnaik

New User


Joined: 19 Mar 2008
Posts: 10
Location: Noida

PostPosted: Tue May 27, 2008 3:24 pm
Reply with quote

Thanks Gerry. Its working .. could you please give teh syntax for Varible length files.

Regards,
Smita
Back to top
View user's profile Send private message
Smita Pattnaik

New User


Joined: 19 Mar 2008
Posts: 10
Location: Noida

PostPosted: Tue May 27, 2008 4:08 pm
Reply with quote

None of the files will contain duplicate data
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue May 27, 2008 4:23 pm
Reply with quote

Hi Smita,
when you say variable length, are the matching keys always in the same position ?



Gerry
Back to top
View user's profile Send private message
Smita Pattnaik

New User


Joined: 19 Mar 2008
Posts: 10
Location: Noida

PostPosted: Tue May 27, 2008 4:41 pm
Reply with quote

Gerry, Can I have the solution for both the cases. In case of the matching keys always in the same position and not in the same key position?

Regards,
Smita
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue May 27, 2008 5:31 pm
Reply with quote

Hi Smita,
I will let Frank handle this one.



Gerry
Back to top
View user's profile Send private message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Tue May 27, 2008 6:25 pm
Reply with quote

Hi,
Do you mean to say that the two input files are of variable length files, i.e VB.

If the keys is present in the same positions 1-15

Code:

//S1       EXEC  PGM=ICETOOL                     
//TOOLMSG  DD SYSOUT=*                           
//DFSMSG   DD SYSOUT=*                           
//IN1      DD DSN=....                                     
//IN2      DD DSN=....                                   
//OUT      DD DSN=
//TOOLIN   DD    *                               
SELECT FROM(IN1) TO(OUT) ON(4,15,CH) NODUPS

If the key is not present in the same position in both input files
first we need to place them in same position and perform the same select statement, and build only the required feilds.
Back to top
View user's profile Send private message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Tue May 27, 2008 6:47 pm
Reply with quote

Small correction:
it is not ON(4,15,CH)
but it is ON(5,15,CH)
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: Tue May 27, 2008 9:14 pm
Reply with quote

Smita,

vvmanyam's job will NOT do what you want (which he would know if he had tested it).

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//CON DD DSN=...  input file1 (VB)
//    DD DSN=...  input file2 (VB)
//OUT DD DSN=...  output file (VB)
//TOOLIN DD *
SELECT FROM(CON) TO(OUT) ON(5,15,CH) NODUPS USING(CTL1)
/*
//CTL1CNTL DD *
  OPTION VLSHRT
/*
Back to top
View user's profile Send private message
mastrahoyar

New User


Joined: 03 Mar 2007
Posts: 17
Location: hyd

PostPosted: Fri May 30, 2008 7:55 pm
Reply with quote

Hi Frank,

Can we do the same by DFSORT?
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: Fri May 30, 2008 9:30 pm
Reply with quote

My job uses ICETOOL which is part of DFSORT (has been since 1991).
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top