Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

To get the odd record from two files
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
dkarthikreddy

New User


Joined: 14 Mar 2008
Posts: 28
Location: bangalore

PostPosted: Tue Aug 18, 2009 11:30 am    Post subject: To get the odd record from two files
Reply with quote

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
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Aug 18, 2009 11:38 am    Post subject:
Reply with quote

What SORT product is available at your shop?

Also give LRECL,RECFM of both the files.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Aug 18, 2009 11:43 am    Post subject:
Reply with quote

/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
View user's profile Send private message
dkarthikreddy

New User


Joined: 14 Mar 2008
Posts: 28
Location: bangalore

PostPosted: Tue Aug 18, 2009 11:48 am    Post subject: Reply to: To get the odd record from two files
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Aug 18, 2009 11:53 am    Post subject:
Reply with quote

Yes, it probably can be done with SORT. Which sort product do you use.
Back to top
View user's profile Send private message
dkarthikreddy

New User


Joined: 14 Mar 2008
Posts: 28
Location: bangalore

PostPosted: Tue Aug 18, 2009 11:55 am    Post subject: Reply to: To get the odd record from two files
Reply with quote

SYNCSORT
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Aug 18, 2009 11:59 am    Post subject:
Reply with quote

LRECL? RECFM?
Show some sample records...
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Aug 18, 2009 12:02 pm    Post subject:
Reply with quote

Also the position, length and dataformat of the keys on which the comparison is to be performed.
Back to top
View user's profile Send private message
dkarthikreddy

New User


Joined: 14 Mar 2008
Posts: 28
Location: bangalore

PostPosted: Tue Aug 18, 2009 12:06 pm    Post subject: Reply to: To get the odd record from two files
Reply with quote

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
View user's profile Send private message
Pankaj Shrivastava
Currently Banned

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Tue Aug 18, 2009 12:12 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Aug 18, 2009 12:18 pm    Post subject:
Reply with quote

Check solution given by Anuj at below thread...
http://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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Tue Aug 18, 2009 1:17 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dkarthikreddy

New User


Joined: 14 Mar 2008
Posts: 28
Location: bangalore

PostPosted: Tue Aug 18, 2009 1:40 pm    Post subject: Reply to: To get the odd record from two files
Reply with quote

hey "arcvns" it worked out. i got the odd record

Thanks a lot to all.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Aug 18, 2009 2:29 pm    Post subject:
Reply with quote

Quote:
i got the odd record

What if your first file doesnt have account number and it is present in second?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Tue Aug 18, 2009 2:37 pm    Post subject: Re: Reply to: To get the odd record from two files
Reply with quote

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
View user's profile Send private message
dkarthikreddy

New User


Joined: 14 Mar 2008
Posts: 28
Location: bangalore

PostPosted: Tue Aug 18, 2009 2:39 pm    Post subject: Reply to: To get the odd record from two files
Reply with quote

I wil put the second file as first file icon_lol.gif

Ok jokes apart... definitely the odd record present in second file would have resulted as odd record
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Aug 18, 2009 2:40 pm    Post subject:
Reply with quote

Sambhaji,

Solution from Arun will take care about that, are you thinking otherwise?
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Aug 18, 2009 3:00 pm    Post subject:
Reply with quote

I'm seriously thinking to get my key-baord changed, aarghhh..three replies before I could comment on what I wanted to... icon_redface.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Aug 18, 2009 3:03 pm    Post subject:
Reply with quote

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... icon_redface.gif

LOL - it's the C2K interface that needs replacing icon_lol.gif
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Aug 18, 2009 3:17 pm    Post subject:
Reply with quote

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... icon_neutral.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us