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

How to realize N:N match in JCL


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

New User


Joined: 27 May 2010
Posts: 47
Location: da lian.china

PostPosted: Tue Feb 22, 2011 8:55 pm
Reply with quote

hello:

How to realize N:N match in jcl? Really in a hurry , waiting for your help and answer.Thank you so much !

input file1

Code:
userid           project_code    action
MARY             T12340           ALTER
JIM                T12340           READ
LUCY              T23450           UPDATE

input file2

Code:
project_code       sub_project_code
T12340                 U11110
T12340                 U22220
T23450                 U33330
T23450                 U44440


anticipate result
Code:
userid           project_code    action
MARY             U11110          ALTER
MARY             U22220          ALTER
JIM                U11110          READ
JIM                U22220          READ
LUCY             U33330          UPDATE
LUCY             U44440          UPDATE
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Feb 22, 2011 8:58 pm
Reply with quote

Quote:
Really in a hurry ,

well what a pity!
remember replying on a forum is
on voluntary basis
on our own time
free of charge
if You have time constraints You are strongly advised to use the services of a paid consultant icon_evil.gif
Back to top
View user's profile Send private message
liying

New User


Joined: 27 May 2010
Posts: 47
Location: da lian.china

PostPosted: Tue Feb 22, 2011 9:06 pm
Reply with quote

enrico-sorichetti wrote:
Quote:
Really in a hurry ,

well what a pity!
remember replying on a forum is
on voluntary basis
on our own time
free of charge
if You have time constraints You are strongly advised to use the services of a paid consultant icon_evil.gif


I am terribly sorry for my improper words. I promise I will not use words like this agian.Thank you so much for your advise. icon_biggrin.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Feb 22, 2011 9:08 pm
Reply with quote

Your sort product might provide the solution...

DFSORT questions get better reply on the DFSORT/ICETOOL section where the answers are provided by DFSORT developers

SYCNSORT question are handled here ( JCL section )

Run the code below and post the JES SYSOUT element so that we can see the sort product and release level that you have installed.

Code:
//FINDOUT  EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY
Back to top
View user's profile Send private message
liying

New User


Joined: 27 May 2010
Posts: 47
Location: da lian.china

PostPosted: Wed Feb 23, 2011 7:59 am
Reply with quote

enrico-sorichetti wrote:
Your sort product might provide the solution...

DFSORT questions get better reply on the DFSORT/ICETOOL section where the answers are provided by DFSORT developers

SYCNSORT question are handled here ( JCL section )

Run the code below and post the JES SYSOUT element so that we can see the sort product and release level that you have installed.

Code:
//FINDOUT  EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY


I am sorry that yesterday it is too late that I received the mail that you have comment to my problem this morning.I have test as you have taught me, and have paste the version information in the below.

Code:
ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                                 
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 11:18 ON WED FE
           SORT FIELDS=COPY                                                     
ICE201I G RECORD TYPE IS F - DATA STARTS IN POSITION 1                         
ICE751I 0 C5-K51707 C6-K51707 C7-K54603 C8-K51707 E9-K51707 C9-BASE   E5-K55337
ICE193I 0 ICEAM1 INVOCATION ENVIRONMENT IN EFFECT - ICEAM1 ENVIRONMENT SELECTED
ICE088I 0 EV615BBA.STEP0020.A       , INPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
ICE093I 0 MAIN STORAGE = (MAX,6291456,6278238)                                 
ICE156I 0 MAIN STORAGE ABOVE 16MB = (6200798,6200798)                           
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,
ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=2097152,MINLIM=450560,EQUALS=N,LIST=Y,ERE
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=FULL ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=
ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=
ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=N,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE    ,EXITC
ICE133I 0 OPTIONS: HIPRMAX=8      ,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMI
ICE235I 0 OPTIONS: NULLOUT=RC0                                                 
ICE084I 0 BSAM ACCESS METHOD USED FOR SORTOUT                                   
ICE084I 0 BSAM ACCESS METHOD USED FOR SORTIN                                   
ICE751I 1 EF-K49535 F0-K49038 E8-K51707                                         
ICE090I 0 OUTPUT LRECL = 80, BLKSIZE = 80, TYPE = FB                           
ICE055I 0 INSERT 0, DELETE 0                                                   
ICE054I 0 RECORDS - IN: 1, OUT: 1                                               
ICE052I 0 END OF DFSORT                                                         
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Feb 23, 2011 8:02 am
Reply with quote

Hello,

The "ICE" messages show that your system is running DFSORT. Your topic has been moved to the DFSORT part of the forum.
Back to top
View user's profile Send private message
liying

New User


Joined: 27 May 2010
Posts: 47
Location: da lian.china

PostPosted: Wed Feb 23, 2011 8:06 am
Reply with quote

dick scherrer wrote:
Hello,

The "ICE" messages show that your system is running DFSORT. Your topic has been moved to the DFSORT part of the forum.


ok,got it.thank you for your contact.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Feb 24, 2011 12:11 am
Reply with quote

liying,

Use the following DFSORT JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//INA      DD *                                             
----+----1----+----2----+----3----+----4----+----5----+----6
MARY             T12340           ALTER                     
JIM              T12340           READ                     
LUCY             T23450           UPDATE                   
//INB      DD *                                             
T12340                 U11110                               
T12340                 U22220                               
T23450                 U33330                               
T23450                 U44440                               
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                             
  OPTION COPY                                               
  JOINKEYS F1=INA,FIELDS=(18,6,A)                           
  JOINKEYS F2=INB,FIELDS=(01,6,A)                           
  REFORMAT FIELDS=(F1:1,17,F2:24,6,F1:24,57)               
//*


The output from the above job is
Code:

MARY             U11110           ALTER   
MARY             U22220           ALTER   
JIM              U11110           READ     
JIM              U22220           READ     
LUCY             U33330           UPDATE   
LUCY             U44440           UPDATE   
Back to top
View user's profile Send private message
liying

New User


Joined: 27 May 2010
Posts: 47
Location: da lian.china

PostPosted: Thu Feb 24, 2011 12:16 pm
Reply with quote

Thank you so much for your help. It is really helpful.And may I ask another question? If there are data in file INA that can not match with file INB, how can I put it to output file without any changes?

for example
INA
Code:

----+----1----+----2----+----3----+----4----+----5----+----6
MARY             T12340           ALTER                     
JIM              T12340           READ                     
LUCY             T23450           UPDATE       
LIYING           T00000           ALL           


INB
Code:
                         
T12340                 U11110                               
T12340                 U22220                               
T23450                 U33330                               
T23450                 U44440                               

The anticipate result
Code:

MARY             U11110           ALTER   
MARY             U22220           ALTER   
JIM              U11110           READ     
JIM              U22220           READ     
LUCY             U33330           UPDATE   
LUCY             U44440           UPDATE   
LIYING           T00000           ALL
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Feb 24, 2011 11:34 pm
Reply with quote

liying,

Use the following control cards
Code:

//SYSIN    DD *                                                         
  OPTION COPY                                                           
  JOINKEYS F1=INA,FIELDS=(18,6,A)                                       
  JOINKEYS F2=INB,FIELDS=(01,6,A)                                       
  JOIN UNPAIRED,F1                                                     
  REFORMAT FIELDS=(F1:1,80,?,F2:24,6)                                   
  INREC IFOUTLEN=80,IFTHEN=(WHEN=(81,1,CH,EQ,C'B'),OVERLAY=(18:82,6))   
//*
Back to top
View user's profile Send private message
liying

New User


Joined: 27 May 2010
Posts: 47
Location: da lian.china

PostPosted: Fri Feb 25, 2011 10:23 am
Reply with quote

It is amazing.Thank you so much for helping me. icon_biggrin.gif
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 JOINKEYS to match two input files on ... DFSORT/ICETOOL 3
No new posts Print next line strings when a condit... DFSORT/ICETOOL 9
No new posts Match two files using multiple keys a... SYNCSORT 11
No new posts Match records - DFSORT/ICETOOL 6
No new posts JCL sort Match and NoMatch SYNCSORT 2
Search our Forums:

Back to Top