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
 

 

Syncsort or FileManager - Eleminating records from file..

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Fri Nov 05, 2010 1:03 am    Post subject: Syncsort or FileManager - Eleminating records from file..
Reply with quote

Hi,
I have 2flat files
File One contains some ids(1-7)
File Two contains some records in which char 15-21 are the Ids,

I need to eliminate the records which are present in the File 1.

Is there any option using SORT/File Manager.

Appreciate and Thanks in Advance.

Regards,
Gaurav Kudesiya
Back to top
View user's profile Send private message

dick scherrer

Site Director


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

PostPosted: Fri Nov 05, 2010 1:04 am    Post subject:
Reply with quote

Hello,

Which sort product is used on your system?
Back to top
View user's profile Send private message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Fri Nov 05, 2010 1:07 am    Post subject:
Reply with quote

DFSORT..
But FILE MANAGER is more prefered...
What you suggest??


Regards
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Nov 05, 2010 1:15 am    Post subject:
Reply with quote

Hello,

If you prefer File Manager, suggest you look in their documentation.

If you want to do this using the sort, your topic can be relocated to the dfsort part of the forum. There are many existing topics on matching files and processing accordingly.
Back to top
View user's profile Send private message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Fri Nov 05, 2010 1:18 am    Post subject: Reply to: Eleminating records from file..
Reply with quote

Thanks.. I'll go through the FileManager.. else DFSORT..
Will Post if stuck up further.

Appreciate your quick response as always.

Regards,
Back to top
View user's profile Send private message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Fri Nov 05, 2010 1:33 am    Post subject:
Reply with quote

I was trying using Include cond()
But not able to figure out what condition to use.
------------------------------------------

File1
-------
ABCDEF1
ABCDEF2
ABCDEF3
ABCDEF4
----
---
--
-
ABCDEFN


File2
----------------------------
DATA ABCDEFD SOME DATA
DATA ABCDEF2 SOME DATA
DATA ABCDEF4 SOME DATA
DATA ABCDEF3 SOME DATA
DATA ABCDEFL SOME DATA
DATA ABCDEF1 SOME DATA
DATA ABCDEFM SOME DATA
DATA ABCDEFH SOME DATA



Output File3
-------------

DATA ABCDEFD SOME DATA
DATA ABCDEFL SOME DATA
DATA ABCDEFM SOME DATA
DATA ABCDEFH SOME DATA

I need to exclude the Whole record of File2 where the ID is present in File1 as above

Confused in what condition is to be used in INCLUDE.



Please help.

Regards,
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Nov 05, 2010 2:05 am    Post subject:
Reply with quote

Hello,

If you are comparing "keys" from 2 different files, INCLUDE is probably not what you'll use.

Suggest you search the DFSORT part of the forum for JOINKEYS.

I'll also move this to the DFSORT part of the forum.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Nov 05, 2010 2:18 am    Post subject:
Reply with quote

You can use a DFSORT job like the following to do what you asked for. I assumed your output records could be in sorted order. If they need to be in the original file2 order, let me know, and I'll show you how to do that. I also assumed your files are FB with positions as shown.

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD *
ABCDEF1
ABCDEF2
ABCDEF3
ABCDEF4
//IN2 DD *
DATA               ABCDEFD                      SOME DATA
DATA               ABCDEF2                      SOME DATA
DATA               ABCDEF4                      SOME DATA
DATA               ABCDEF3                      SOME DATA
DATA               ABCDEFL                      SOME DATA
DATA               ABCDEF1                      SOME DATA
DATA               ABCDEFM                      SOME DATA
DATA               ABCDEFH                      SOME DATA
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  JOINKEYS F1=IN1,FIELDS=(1,7,A)
  JOINKEYS F2=IN2,FIELDS=(20,7,A)
  JOIN UNPAIRED,F2,ONLY
  OPTION COPY


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
Back to top
View user's profile Send private message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Fri Nov 05, 2010 2:31 am    Post subject:
Reply with quote

@FY and DS : Trying the same thing...
Will update this in some time..
Thanks

Regards,
Back to top
View user's profile Send private message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Fri Nov 05, 2010 2:49 am    Post subject:
Reply with quote

Tried the below
Code:
//STEP05 EXEC PGM=SORT                                       
//IN1      DD DSN=T0199RK.T0084GK.TESTING.INPUT1,DISP=SHR     
//IN2      DD DSN=T0199RK.T0084GK.TESTING.INPUT2,DISP=SHR     
//SORTOUT DD DSN=T0199RK.T0084GK.TESTING.OUTPUT,DISP=SHR     
//SYSIN DD *                                                 
 JOINKEYS F1=IN1,FIELDS=(1,7,A)                               
 JOINKEYS F2=IN2,FIELDS=(24,7,A)                             
 JOIN UNPAIRED,F2,ONLY                                       
 SORT FIELDS=COPY                                             
//SYSOUT DD SYSOUT=*                                         


Getting the below error.
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 1F464, MODEL 2097 603
SYSIN :
JOINKEYS F1=IN1,FIELDS=(1,7,A)
*
JOINKEYS F2=IN2,FIELDS=(24,7,A)
*
JOIN UNPAIRED,F2,ONLY
*
SORT FIELDS=COPY
*
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE


Tried everything, if i missed some syntex.. but gettting the same error

Regards,
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Nov 05, 2010 2:58 am    Post subject:
Reply with quote

Hello,

Originally you said you use DFSORT. This output is from Syncsort . . .
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Nov 05, 2010 3:02 am    Post subject:
Reply with quote

Hello,

See if this previous topic will help:

http://ibmmainframes.com/viewtopic.php?t=51571
Back to top
View user's profile Send private message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Fri Nov 05, 2010 3:03 am    Post subject:
Reply with quote

I tried with the SORT.

But now its working

@Frank Yaeger:

I was missing teh DD names.
We can not use IN1 and IN2

It should be
Quote:
//STEP05 EXEC PGM=SORT
//SORTJNF1 DD DSN=T0199RK.T0084GK.TESTING.INPUT1.NEW,DISP=SHR
//SORTJNF2 DD DSN=T0199RK.T0084GK.TESTING.INPUT2.NEW,DISP=SHR
//SORTOUT DD DSN=T0199RK.T0084GK.TESTING.OUTPUT,DISP=SHR
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,7,A)
JOINKEYS FILE=F2,FIELDS=(24,7,A)
JOIN UNPAIRED,F2,ONLY
SORT FIELDS=COPY
//SYSOUT DD SYSOUT=*
//*


Anyways, Thanks for the approach..
Its working now..
Thanks againg

Regards,
Gaurav
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Nov 05, 2010 3:19 am    Post subject: Reply to: Syncsort or FileManager - Eleminating records from
Reply with quote

Good to hear it is working - thank you for posting your solution icon_smile.gif

d
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Nov 05, 2010 3:22 am    Post subject:
Reply with quote

Quote:
I tried with the SORT.


There's no such thing as "the SORT". There's DFSORT, Syncsort and CA-Sort.

The job I posted works fine with DFSORT.

However, although you said you are using DFSORT, you are actually using Syncsort.
Back to top
View user's profile Send private message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Fri Nov 05, 2010 2:01 pm    Post subject:
Reply with quote

I didnt try it with DFSORT, but with SORT, it was not taking those DD Names. BUt it worked with below code:
Code:
//STEP05 EXEC PGM=SORT
//SORTJNF1 DD DSN=T0199RK.T0084GK.TESTING.INPUT1.NEW,DISP=SHR
//SORTJNF2 DD DSN=T0199RK.T0084GK.TESTING.INPUT2.NEW,DISP=SHR
//SORTOUT DD DSN=T0199RK.T0084GK.TESTING.OUTPUT,DISP=SHR
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,7,A)
JOINKEYS FILE=F2,FIELDS=(24,7,A)
JOIN UNPAIRED,F2,ONLY
SORT FIELDS=COPY
//SYSOUT DD SYSOUT=*
//*


Rest all looks gud

Regards,
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Nov 05, 2010 7:22 pm    Post subject:
Reply with quote

Hello,

It matters very little what you believe you execute. . . Many/most places can execute "SORT" for whichever sort product is being used. That is no reason to be unaware of which product is actually in use.

The informational output from the sort shows which sort product (and which release or ptf level) is being used.

One big reason this is important is that if one does not understand which product is in use, it makes it impossible to know which documentation to use to find specifics. While the sort products have many similarities, there are also quite a few differences (as you have just discovered icon_smile.gif ).
Back to top
View user's profile Send private message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Fri Nov 05, 2010 7:30 pm    Post subject:
Reply with quote

I Agree....
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm


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