View previous topic :: View next topic
|
Author |
Message |
dkarthikreddy
New User
Joined: 14 Mar 2008 Posts: 28 Location: bangalore
|
|
|
|
Hi All,
I have two files with 15 byte account number, in one file i have 171 records and in another file i have the same set of acct numbers but the count here is 170. Now i need that odd one account from first file. How can i get that using JCL.
Thanks
Karthik |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
What SORT product is available at your shop?
Also give LRECL,RECFM of both the files. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
/RANT ON
Once more let us clarify exactly what JCL is.
it is Job Control Language.
By itself it does nothing. It is used to invoke the chosen program and to define which datasets are to be used by the DD names associated with the chosen program.
JCL does not have magical powers that solve all problems, JCL is merely the vehicule for telling the processor which program you want it to execute.
/RANT OFF
So, if you might just care to tell us which program you wish the JCL to execute, we might be able to help you |
|
Back to top |
|
|
dkarthikreddy
New User
Joined: 14 Mar 2008 Posts: 28 Location: bangalore
|
|
|
|
I meant to say JCL means using a SORT card (PGM = SORT). Can i do using any sort in jcl ( i can do with a cobol pgm ). |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Yes, it probably can be done with SORT. Which sort product do you use. |
|
Back to top |
|
|
dkarthikreddy
New User
Joined: 14 Mar 2008 Posts: 28 Location: bangalore
|
|
|
|
SYNCSORT |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
LRECL? RECFM?
Show some sample records... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Also the position, length and dataformat of the keys on which the comparison is to be performed. |
|
Back to top |
|
|
dkarthikreddy
New User
Joined: 14 Mar 2008 Posts: 28 Location: bangalore
|
|
|
|
RECFM=FB
LRECL=15 bytes
The file record length is 80 bytes and the first 15 bytes is relevant to us.
eg: 111111111111111 ( 15 bytes)
(1,15,CH,A) |
|
Back to top |
|
|
Pankaj Shrivastava Currently Banned New User
Joined: 24 Jul 2009 Posts: 51 Location: Pune
|
|
|
|
If just for testing , Can use Superce .If want comparison on specific column ,Then compare on coulm number (E option: CMPCOLM
) , Need JCl ..execute in batch . |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Check solution given by Anuj at below thread...
www.ibmmainframes.com/about23191.html
In this only
Output1= Non-matching records only in in-file1 not in in-file2
i.e. missing in second file....
is useful for you. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
dkarthikreddy,
You can give this a try.
Code: |
//STEP1 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN= Input-file1
// DD DSN= Input-file2
//OUT DD DSN= Output-file
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,15,CH) NODUPS |
|
|
Back to top |
|
|
dkarthikreddy
New User
Joined: 14 Mar 2008 Posts: 28 Location: bangalore
|
|
|
|
hey "arcvns" it worked out. i got the odd record
Thanks a lot to all. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Quote: |
i got the odd record
|
What if your first file doesnt have account number and it is present in second? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
dkarthikreddy wrote: |
hey "arcvns" it worked out. i got the odd record
Thanks a lot to all. |
You're welcome. Note that the above job extracts 'odd records' from file-2 also if there are any. |
|
Back to top |
|
|
dkarthikreddy
New User
Joined: 14 Mar 2008 Posts: 28 Location: bangalore
|
|
|
|
I wil put the second file as first file
Ok jokes apart... definitely the odd record present in second file would have resulted as odd record |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Sambhaji,
Solution from Arun will take care about that, are you thinking otherwise? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
I'm seriously thinking to get my key-baord changed, aarghhh..three replies before I could comment on what I wanted to... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Anuj Dhawan wrote: |
I'm seriously thinking to get my key-baord changed, aarghhh..three replies before I could comment on what I wanted to... |
LOL - it's the C2K interface that needs replacing |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
dkarthikreddy
wrote: |
I wil put the second file as first file
Ok jokes apart... definitely the odd record present in second file would have resulted as odd record |
I didn't ask to change the order...
Anuj wrote: |
Solution from Arun will take care about that, are you thinking otherwise?
|
f1:
1
2
3
5
f2:
1
2
3
6
In this case if OP requires both 5 and 6 as missing then fine..
But I thought missing in f2 (which is asked by OP) is only 6... |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Quote: |
in one file i have 171 records and in another file i have the same set of acct numbers but the count here is 170 |
Per this statement, only one record is missing... |
|
Back to top |
|
|
|