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

how to match record from 2 datasets


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Mon May 28, 2007 3:26 pm
Reply with quote

Code:

//STEP2 EXEC  PGM=ICETOOL                               
//SYSPRINT DD SYSOUT=*                                 
//SYSDBOUT DD SYSOUT=*                                 
//SYSOUT   DD SYSOUT=*                                 
//TOOLMSG  DD SYSOUT=*                                 
//SSMSG    DD SYSOUT=*                                 
//IN1      DD DSN=&&ENFTR02,DISP=(OLD,DELETE)           
//IN2      DD DSN=MIFENDPN.PROD.ENFD00S.OLD,DISP=SHR   
//T1       DD DSN=&&ENFTR03,UNIT=SYSDA,                 
//            SPACE=(CYL,(5,5),RLSE),DISP=(,PASS)
//OUT      DD DSN=&&ENFTR04,DISP=(,PASS),               
//            SPACE=(CYL,(70,5),RLSE)
//TOOLIN DD *                                           
COPY   FROM(IN1) TO(T1) USING(CTL1)                     
COPY   FROM(IN2) TO(T1) USING(CTL2)                     
SELECT FROM(T1)  TO(OUT) ON(1,451,BI) NODUPS USING(CTL3)
/*                                                     
//CTL1CNTL DD *                                         
  OUTREC FIELDS=(1,450,451:C'1')                         
/*                                                     
//CTL2CNTL DD *                                         
  OUTREC FIELDS=(1,450,451:C'2')                         
/*                                                     
//CTL3CNTL DD *                                         
  OUTFIL FNAMES=OUT,INCLUDE=(451,1,CH,EQ,C'1')           


in1=333285
in2=333255
out=333255 or 333285

this is what I'll wanna do
333285-
333255
______
30

I'm not able to do....
please help me
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon May 28, 2007 3:39 pm
Reply with quote

miosne,

Please explain your requirement clearly. Your post is bit confusing
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Mon May 28, 2007 3:46 pm
Reply with quote

I'll wanna found different records between in1 and in2.
when I found them I'll wanna keep the rec's from in1.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon May 28, 2007 4:13 pm
Reply with quote

miosne
do u want all the records in IN1 that are not in IN2?
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Mon May 28, 2007 5:29 pm
Reply with quote

all the records in IN1 that are not in IN2 and the differents


t.y.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon May 28, 2007 6:39 pm
Reply with quote

miosne

In this SPLICE example, the input records from data sets FILE1 and FILE2 are separated into the following
output data sets:
? BOTH: records that appear in FILE1 and FILE2
? F1ONLY: records that only appear in FILE1
? F2ONLY: records that only appear in FILE2

Code:
//*******************************************************               
//STEP001  EXEC PGM=ICETOOL                                             
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN1      DD *                                                         
VICKY                                                                   
FRANK                                                                   
CARRIE                                                                 
HOLLY                                                                   
PAUL                                                                   
/*                                                                     
//IN2      DD *                                                         
KAREN                                                                   
HOLLY                                                                   
CARRIE                                                                 
VICKY                                                                   
MARY                                                                   
/*                                                                     
//TMP1     DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA 
//BOTH     DD SYSOUT=*                                                 
//F1ONLY   DD SYSOUT=*                                                 
//F2ONLY   DD SYSOUT=*                                                 
//TOOLIN   DD *                                                         
 COPY FROM(IN1)  TO(TMP1) USING(CP01)                                   
 COPY FROM(IN2)  TO(TMP1) USING(CP02)                                   
 SPLICE FROM(TMP1) TO(BOTH) ON(1,10,CH) WITH(13,1) -                   
                            USING(CP03) KEEPNODUPS                     
/*                                                                     
//CP01CNTL DD   *                                                       
  OUTREC BUILD=(1,10,12:C'11')                                         
/*                                                                     
//CP02CNTL DD   *                                                       
  OUTREC BUILD=(1,10,12:C'22')                                         
/*                                                                     
//CP03CNTL DD   *                                                       
  OUTFIL FNAMES=BOTH,INCLUDE=(12,2,CH,EQ,C'12'),BUILD=(1,10)           
  OUTFIL FNAMES=F1ONLY,INCLUDE=(12,2,CH,EQ,C'11'),BUILD=(1,10)         
  OUTFIL FNAMES=F2ONLY,INCLUDE=(12,2,CH,EQ,C'22'),BUILD=(1,10)         
/*                                                                     



Use this to suitably build your code.
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: Mon May 28, 2007 10:06 pm
Reply with quote

krish,

Would you please point to the complete Smart DFSORT Trick you're regurgitating instead of just posting part of it. In this case, it's the "Create files with matching and non-matching records" Smart DFSORT Trick at:

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/

Please copy that down and use it in the future!
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue May 29, 2007 12:51 pm
Reply with quote

frank
i had considered the same example from sortnew.pdf, but i could not point to any specific topic. So pasted the code here.
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Tue May 29, 2007 8:01 pm
Reply with quote

My system does not support "inrec overlay"
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Tue May 29, 2007 8:31 pm
Reply with quote

My English is not good.
If I explain myself badly you have patience.
If I am too much insistent,it is because I never do not succeed to explain to me well.
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Tue May 29, 2007 8:59 pm
Reply with quote

in short I have 2 files that they contain records that they arrive from vsam with a sort therefore to key parity.
I must obtain all the records that they have been modified, in accidental way inside of all the rows.

infinitely thanks who has helped me to write and you that you have much patience
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 29, 2007 9:02 pm
Reply with quote

Quote:
i had considered the same example from sortnew.pdf, but i could not point to any specific topic. So pasted the code here.


Well, you could at least have said where you got the example from.
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 29, 2007 9:11 pm
Reply with quote

Quote:
My system does not support "inrec overlay"


Which sort product are you using? If you don't know, look at the messages you received in //SYSOUT - are they ICExxxs messages (DFSORT) or WERxxxs messages (Syncsort) or CASxxxs messages (CA-SORT)?

Unfortunately, due to your problems with English, we are not able to understand what you're trying to do, making it difficult for us to help you.

In your first post, you showed an example of the records in in1, in2 and out, but you only showed one record for in1 and in2, and it wasn't clear what you did to get out. Can you show a better example of the records in in1 and in2 (more records) and what you want in out, and explain the "rules" for getting from input to output?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue May 29, 2007 11:19 pm
Reply with quote

Hello miosne,

Please post a few records from in1 and in2 and what you want for output if those few records were the entire input for a run. If you need to "match" records from the 2 datasets, please mention what position the "match key" begins in and how long it is. Also, what is the lrecl of each the files? Are they FB or VB or ?

This
Quote:
in1=333285
in2=333255
out=333255 or 333285

this is what I'll wanna do
333285-
333255
______
30
is unclear to me.

If you show how it relates to your input, it will help. Once the requirement is understood, better suggestions will be posted.
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Wed May 30, 2007 6:58 pm
Reply with quote

The position of the key is 1,9.
The lrecl is 450 FB.
The part to verify begins to the position 10.
Here some examples of the two files:
IN1
<---key--><----------data------------>
000000001simone
000000002antonio miraglia
000000003monti
000000004roberto rossi
000000005norberto marzagalli
000000006cristiano castelli

IN2
<---key--><----------data------------>
000000001simone lissi
000000002antonio miraglia
000000003aldo monti
000000004roberto rossi

OUT
<---key--><----------data------------>
000000001simone
000000003monti
000000005norberto marzagalli
000000006cristiano castelli

Comparison the first one with the second and I must obtain the variations to key parity (key 000000001 and 000000003)
moreover the eventual ones in more present in the first one (key 000000005 and 000000006)

Many thanks and having a good day from Italy

miosne
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed May 30, 2007 8:35 pm
Reply with quote

miosne
Please check this code

Code:
//*******************************************************               
//STEP001  EXEC PGM=ICETOOL                                             
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN1      DD *                                                         
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000000001SIMONE                                                         
000000002ANTONIO MIRAGLIA                                               
000000003MONTI                                                         
000000004ROBERTO ROSSI                                                 
000000005NORBERTO MARZAGALLI                                           
000000006CRISTIANO CASTELLI                                             
/*                                                                     
//IN2      DD *                                                         
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000000001SIMONE LISSI                                                   
000000002ANTONIO MIRAGLIA                                               
000000003ALDO MONTI                                                     
000000004ROBERTO ROSSI                                                 
/*                                                                     
//TMP1     DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA 
//BOTH     DD SYSOUT=*                                                 
//F1ONLY   DD SYSOUT=*                                                 
//F2ONLY   DD SYSOUT=*                                                 
//TOOLIN   DD *                                                         
 COPY FROM(IN1)  TO(TMP1) USING(CP01)                                   
 COPY FROM(IN2)  TO(TMP1) USING(CP02)                                   
 SPLICE FROM(TMP1) TO(BOTH) ON(1,9,CH)  ON(10,20,CH)   WITH(10,20) -   
       WITH(32,1)  KEEPNODUPS     USING(CP03)                           
/*                                                                     
//CP01CNTL DD   *                                                       
  OUTREC BUILD=(1,30,31:C'11')                                         
/*                                                                     
//CP02CNTL DD   *                                                       
  OUTREC BUILD=(1,30,31:C'22')                                         
/*                                                                     
//CP03CNTL DD   *                                                       
  OUTFIL FNAMES=BOTH,INCLUDE=(31,2,CH,EQ,C'12'),BUILD=(1,30)           
  OUTFIL FNAMES=F1ONLY,INCLUDE=(31,2,CH,EQ,C'11'),BUILD=(1,30)         
  OUTFIL FNAMES=F2ONLY,INCLUDE=(31,2,CH,EQ,C'22'),BUILD=(1,30)         
/*                                                                     


Now the file F1ONLY contains the required o/p:
Code:
000000001SIMONE               
000000003MONTI                 
000000005NORBERTO MARZAGALLI   
000000006CRISTIANO CASTELLI   


Let me know if u needed something else!! icon_exclaim.gif
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: Wed May 30, 2007 9:39 pm
Reply with quote

miosne,

Kriprems is on the right track, but you don't need to create three output data sets given that you only need one. Here's a modified DFSORT/ICETOOL job that will create just the one data set you want:

Code:

//STEP001  EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//IN1      DD *
000000001SIMONE
000000002ANTONIO MIRAGLIA
000000003MONTI
000000004ROBERTO ROSSI
000000005NORBERTO MARZAGALLI
000000006CRISTIANO CASTELLI
/*
//IN2      DD *
000000001SIMONE LISSI
000000002ANTONIO MIRAGLIA
000000003ALDO MONTI
000000004ROBERTO ROSSI
/*
//TMP1     DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//F1ONLY   DD SYSOUT=*
//TOOLIN   DD *
 COPY FROM(IN1)  TO(TMP1) USING(CP01)
 COPY FROM(IN2)  TO(TMP1) USING(CP02)
 SPLICE FROM(TMP1) TO(F1ONLY) ON(1,9,CH) ON(10,20,CH) -
   WITH(32,1) KEEPNODUPS USING(CP03)
/*
//CP01CNTL DD   *
  OUTREC BUILD=(1,30,31:C'11')
/*
//CP02CNTL DD   *
  OUTREC BUILD=(1,30,31:C'22')
/*
//CP03CNTL DD   *
  OUTFIL FNAMES=F1ONLY,INCLUDE=(31,2,CH,EQ,C'11'),BUILD=(1,30)
/*
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Thu May 31, 2007 1:55 pm
Reply with quote

while I hope you having a good day.
watch the source below
//IN1 DD DSN=&&ENFTR02,DISP=(OLD,DELETE)
//IN2 DD DSN=MIFENDPN.PROD.ENFD00S.OLD,DISP=SHR
//T1 DD DSN=&&ENFTR03,UNIT=SYSDA,DISP=(,PASS),
// SPACE=(CYL,(5,5),RLSE),
// DCB=(RECFM=FB,LRECL=452)
//OUT12 DD DSN=MIFENDDN.SVIL.ENSI012.OUT12,DISP=(,CATLG),
// SPACE=(CYL,(5,1),RLSE),
// DCB=(RECFM=FB,LRECL=450)
//OUT1 DD DSN=MIFENDDN.SVIL.ENSI012.OUT11,DISP=(,CATLG),
// SPACE=(CYL,(5,1),RLSE),
// DCB=(RECFM=FB,LRECL=450)
//OUT2 DD DSN=MIFENDDN.SVIL.ENSI012.OUT22,DISP=(,CATLG),
// SPACE=(CYL,(5,1),RLSE),
// DCB=(RECFM=FB,LRECL=450)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CP01)
COPY FROM(IN2) TO(T1) USING(CP02)
SPLICE FROM(T1) TO(OUT12) ON(1,9,CH) ON(10,440,CH) WITH(10,440) -
WITH(452,1) KEEPNODUPS USING(CP03)
/*
//CP01CNTL DD *
OUTREC FIELDS=(1,450,451:C'11')
/*
//CP02CNTL DD *
OUTREC FIELDS=(1,450,451:C'22')
/*
//CP03CNTL DD *
OUTFIL FNAMES=OUT12,INCLUDE=(451,2,CH,EQ,C'12'),BUILD=(1,450)
OUTFIL FNAMES=OUT1,INCLUDE=(451,2,CH,EQ,C'11'),BUILD=(1,450)
OUTFIL FNAMES=OUT2,INCLUDE=(451,2,CH,EQ,C'22'),BUILD=(1,450)
//*

the return code is 00 the response i dont understand because I found out1 and out2 empty and all the records in out12.


you have good day and salutes to all


miosne
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: Thu May 31, 2007 8:24 pm
Reply with quote

miosne,

You don't have MOD for T1 as you should. I don't know if that's the only problem.

You might want to try adapting my job as its more efficient for what you said you wanted to do.
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Thu May 31, 2007 9:15 pm
Reply with quote

I do not want to adapt your job to mine.
I ask excuse.
I have only wants to make in order to learn .
I will be more careful, and I will try to follow more your indications.


Thank you very much, miosne.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Copy only TEXT or String from a record SYNCSORT 4
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
No new posts how to complete the end of a record w... DFSORT/ICETOOL 2
No new posts JES datasets IO Error ABENDS & Debugging 3
Search our Forums:

Back to Top