View previous topic :: View next topic
|
Author |
Message |
Smita Dalvi
New User
Joined: 12 Dec 2009 Posts: 3 Location: mumbai
|
|
|
|
Hi All,
I have following requirement.
I have two files. File A (94 bytes , FB) and File B (188 bytes). These two files to be matched on key (80,15,ch,a), and then write the output with 94 bytes from File A and rest 94 bytes from File B (95:94). The output file would be of 188 bytes.
There are two matching records in file B wherein one matching record in file A. Hence Two records from file B should be written in output file with mathcing record from file A.
I tried 'join keys' function but it does not support in my system. Hence I looked at many example using Splice option to merge files. However Its giving me syntax error as key starts at 80.
Can someone help me out to get desired output with Splice option.
Thanks,
Smita Dalvi |
|
Back to top |
|
|
Senthilkumar k Warnings : 1 New User
Joined: 07 May 2009 Posts: 51 Location: Chennai
|
|
|
|
Please use search option in forum. I believe lot of examples are available for this. |
|
Back to top |
|
|
Lijo
New User
Joined: 24 Aug 2008 Posts: 41 Location: Cochin
|
|
|
|
Please use this one:
Code: |
S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=<FILEA>
//IN2 DD DSN=<FILEB>
//OUT12 DD DSN=<MATCH FILE>
//OUT1 DD DSN=<FILEA-FILEB>
//OUT2 DD DSN=<FILEB-FILEA>
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(5,5)),
// DISP=(MOD,PASS)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT12) ON(80,15,CH) WITH(95,95) -
WITHALL KEEPNODUPS USING(CTL3)
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1,94,94X,189:C'11')
/*
//CTL2CNTL DD *
OUTREC FIELDS=(1,188,189:C'22')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT12,INCLUDE=(189,2,CH,EQ,C'21'),OUTREC=(1,188)
OUTFIL FNAMES=OUT1,INCLUDE=(189,2,CH,EQ,C'11'),OUTREC=(1,188)
OUTFIL FNAMES=OUT2,INCLUDE=(189,2,CH,EQ,C'22'),OUTREC=(1,188)
/* |
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
Smita Dalvi
New User
Joined: 12 Dec 2009 Posts: 3 Location: mumbai
|
|
|
|
I tried this option. But it didnt give me desired output. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Show us the complete messages you are receiving. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I tried this option. But it didnt give me desired output. |
Well, that certainly is unfortunate. . .
And that may be the best you will receive until you post something more useful than "it didn't work". . .
What happened? An abend, some error, partially correct output, completely incorrect output. . .?
Post some sample input and the exact output yuou want from that input. Post any info regarding the problem run. |
|
Back to top |
|
|
Smita Dalvi
New User
Joined: 12 Dec 2009 Posts: 3 Location: mumbai
|
|
|
|
Sorry guys for not detailing the problem.
I am getting 3 records in matched output file from file A. However I want to write records from File B (all matched duplicate records).
Also the records are not appended with (95:94) bytes of matched record from file A. |
|
Back to top |
|
|
Lijo
New User
Joined: 24 Aug 2008 Posts: 41 Location: Cochin
|
|
|
|
Have you used JCL provided above or JOINKEYS option? If its JOINKEYS, you need to post the JCL so that we can check it out.
If you've used above JCL,
Still you've not provided the input data and desired output data.
Quote: |
I am getting 3 records in matched output file from file A. |
You meant, you're getting 3 output records for each matched record between File A & B? How can we identify, how this records are coming without giving File A & B's data?
I would like to see the JCL used. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Sorry guys for not detailing the problem. |
And you still have not.
What part of this was not clear?
Quote: |
Post some sample input and the exact output you want from that input. Post any info regarding the problem run. |
Post a small amount of the input used, the output wanted from that sample and the output that was actually written. Post the jcl and control statements. |
|
Back to top |
|
|
|