IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Syncsort or FileManager - Eleminating records from file..


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Fri Nov 05, 2010 1:04 am
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
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

Moderator Emeritus


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

PostPosted: Fri Nov 05, 2010 1:15 am
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
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
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

Moderator Emeritus


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

PostPosted: Fri Nov 05, 2010 2:05 am
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 Developer


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

PostPosted: Fri Nov 05, 2010 2:18 am
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:

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
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
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

Moderator Emeritus


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

PostPosted: Fri Nov 05, 2010 2:58 am
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

Moderator Emeritus


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

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

Hello,

See if this previous topic will help:

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
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

Moderator Emeritus


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

PostPosted: Fri Nov 05, 2010 3:19 am
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 Developer


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

PostPosted: Fri Nov 05, 2010 3:22 am
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
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

Moderator Emeritus


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

PostPosted: Fri Nov 05, 2010 7:22 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top