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
 

 

Match records and retain duplicates

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Sathish Gurumoorthy

New User


Joined: 12 Feb 2009
Posts: 33
Location: Chennai, India

PostPosted: Fri Jul 02, 2010 11:35 am    Post subject: Match records and retain duplicates
Reply with quote

Hi,

I have an below input file of RECFM=FB and LRECL = 80.

Code:
----+----1----+----2----+----3----+----4----+----5----+----6--
PROD1 FIGARO FIG0 HBB700     COBOLFIG P COBOLBND G974890 01 07
PROD1 FIGARO FIG0 HBB705     COBOLFIG P COBOLBND         01 01
PROD1 FIGARO FIG0 HBB710     COBOLFIG P COBOLBND         01 00
PROD1 FIGARO FIG0 HBB720     COBOLFIG P COBOLBND         01 00
PROD1 FIGARO FIG0 HBE000     COBOLFIG P COBOLOCD         01 00
PROD1 FIGARO FIG0 HBE001     COBOLFIG P COBOLOCD         01 00
PROD1 FIGARO FIG0 HBE002     COBOLFIG P COBOLOCD         01 00
PROD1 FIGARO FIG0 HBE003     COBOLFIG P COBOLOCD         01 00
PROD1 FIGARO FIG0 HBE500     COBOLFIG P COBOLOCD G270207 01 01
PROD1 FIGARO FIG0 HBE501     COBOLFIG P COBOLOCD         01 02
PROD1 FIGARO FIG0 HBE502     COBOLFIG P COBOLOCD         01 00
PROD1 FIGARO FIG0 HBE510     COBOLFIG P COBOLOCD         01 01
PROD1 FIGARO FIG0 HBE520     COBOLFIG P COBOLOCD         01 00
PROD1 FIGARO FIG0 HBE521     COBOLFIG P COBOLOCD         01 00
PROD1 FIGARO FIG0 HBE540     COBOLFIG P COBOLACD G974643 01 02
PROD1 FIGARO FIG0 HRB810     COBOLFIG P COBOLBND G974476 01 09

DEVF1 FIGARO FIG8 HBB700     COBOLFIG E COBOLBND G974890 01 07
DEVF1 FIGARO FIG8 HBE540     COBOLFIG E COBOLACD G974613 01 02
DEVF1 FIGARO FIG8 HBE570     COBOLFIG E COBOLACD G974611 01 22
DEVF1 FIGARO FIG8 HBE810     COBOLFIG E COBOLACD G974890 01 03
DEVF1 FIGARO FIG8 HBO540     COBOLFIG E COBOLOCD G974611 01 00
DEVF1 FIGARO FIG8 HBS510     COBOLFIG E COBOLACD G974890 01 05
DEVF1 FIGARO FIG8 HBS600     COBOLFIG E COBOLACD G974890 01 07
DEVF1 FIGARO FIG8 HRB810     COBOLFIG E COBOLBND G974611 01 09


Positions
1-5: Environment
7-12: system
14-17: sub system
19-28: Element
30-37: Type
39 : Stage

Now, I want the output with only elements present in both DEVF1 & PROD1
Ignore the elements which are present only in PROD1 or DEVF1.

output should be like below.


Code:
----+----1----+----2----+----3----+----4----+----5----+----6--
PROD1 FIGARO FIG0 HBB700     COBOLFIG P COBOLBND G974890 01 07
PROD1 FIGARO FIG0 HBE540     COBOLFIG P COBOLACD G974643 01 02
PROD1 FIGARO FIG0 HRB810     COBOLFIG P COBOLBND G974476 01 09

DEVF1 FIGARO FIG8 HBB700     COBOLFIG E COBOLBND G974890 01 07
DEVF1 FIGARO FIG8 HBE540     COBOLFIG E COBOLACD G974613 01 02
DEVF1 FIGARO FIG8 HRB810     COBOLFIG E COBOLBND G974611 01 09


is there any way to do this using SORT?

Thanks,
Sathish.
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 Jul 02, 2010 8:52 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will give you what I think you're asking for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD DSN=...  input file (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file (FB/80)
//TOOLIN DD *
SELECT FROM(IN) TO(T1) ON(19,10,CH) ALLDUPS
SORT FROM(T1) TO(OUT) USING(CTL1)
/*
//CTL1CNTL DD *
  SORT FIELDS=(1,5,CH,D,19,10,CH,A)
/*
Back to top
View user's profile Send private message
Sathish Gurumoorthy

New User


Joined: 12 Feb 2009
Posts: 33
Location: Chennai, India

PostPosted: Tue Jul 06, 2010 8:13 am    Post subject:
Reply with quote

Thanks frank. It works icon_smile.gif
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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


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