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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: DFSORT/ICETOOL - how to get the unique records of a file.
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: 195
Location: India

PostPosted: Tue May 27, 2008 12:16 pm    Post subject: Reply to: DFSORT/ICETOOL - how to get the unique records of
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: 1703
Location: Australia

PostPosted: Tue May 27, 2008 1:47 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Tue May 27, 2008 2:04 pm    Post subject:
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    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Tue May 27, 2008 4:23 pm    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Tue May 27, 2008 5:31 pm    Post subject:
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    Post subject: Reply to: DFSORT/ICETOOL - how to get the unique records of
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    Post subject: Reply to: DFSORT/ICETOOL - how to get the unique records of
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 Moderator


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

PostPosted: Tue May 27, 2008 9:14 pm    Post subject:
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    Post subject: Reply
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 Moderator


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

PostPosted: Fri May 30, 2008 9:30 pm    Post subject:
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    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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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