View previous topic :: View next topic
|
Author |
Message |
Smita Pattnaik
New User
Joined: 19 Mar 2008 Posts: 10 Location: Noida
|
|
|
|
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 |
|
|
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 194 Location: India
|
|
|
|
Use the PGM=SORT and input cards as Sort field = ...... and SUM FIELDS=NONE to get unique records. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
Smita Pattnaik
New User
Joined: 19 Mar 2008 Posts: 10 Location: Noida
|
|
|
|
Thanks Gerry. Its working .. could you please give teh syntax for Varible length files.
Regards,
Smita |
|
Back to top |
|
|
Smita Pattnaik
New User
Joined: 19 Mar 2008 Posts: 10 Location: Noida
|
|
|
|
None of the files will contain duplicate data |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Smita,
when you say variable length, are the matching keys always in the same position ?
Gerry |
|
Back to top |
|
|
Smita Pattnaik
New User
Joined: 19 Mar 2008 Posts: 10 Location: Noida
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Smita,
I will let Frank handle this one.
Gerry |
|
Back to top |
|
|
vvmanyam
New User
Joined: 16 Apr 2008 Posts: 86 Location: Bangalore
|
|
|
|
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 |
|
|
vvmanyam
New User
Joined: 16 Apr 2008 Posts: 86 Location: Bangalore
|
|
|
|
Small correction:
it is not ON(4,15,CH)
but it is ON(5,15,CH) |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
mastrahoyar
New User
Joined: 03 Mar 2007 Posts: 17 Location: hyd
|
|
|
|
Hi Frank,
Can we do the same by DFSORT? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
My job uses ICETOOL which is part of DFSORT (has been since 1991). |
|
Back to top |
|
|
|