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 - Removing matching records from files

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

New User


Joined: 10 Jul 2008
Posts: 6
Location: 23rdSt-Ely Ave,Long Island city,NY

PostPosted: Sat Aug 28, 2010 9:16 am    Post subject: Syncsort - Removing matching records from files
Reply with quote

Hi,

I have two files with the same length. I need to delete the records from the second file if the records existing in the first file.

For this I have written below JCL and when I was trying to execute this it is giving below error. I have attached the screen shot


Please give me some suggestion how to resolve this issue.


Regards
Venkat
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: Sat Aug 28, 2010 9:37 am    Post subject:
Reply with quote

Hello,

Many of our contributors are not able to download attachments.

Please repost your info using copy/paste and the Code tag. Use Preview to see how your post will appear to the forum (rather than how it looks in the Reply Editor). When the appearance is as you want it, Submit.

If you copy/paste from the terminal, no "adjusting" is necessary - the Code will preserve the alignment.
Back to top
View user's profile Send private message
gvenkateshmca

New User


Joined: 10 Jul 2008
Posts: 6
Location: 23rdSt-Ely Ave,Long Island city,NY

PostPosted: Sun Aug 29, 2010 9:50 am    Post subject:
Reply with quote

Hi,

I have two files with same length, I need to delete the records from the second file if the records are present in the first file.(only i need to delete the records which are matching from first file). For this I have written the below JCL and when I was trying to execute I am getting below error. please find the below JCL and Error message


Code:
//SORT00    EXEC PGM=SORT                                             
 //SYSOUT   DD SYSOUT=*                                                 
 //SORTIN   DD DSN=TSHRCI.N548B5.NPTFLIB1.TEST,DISP=SHR                 
 //OUT      DD DSN=&&HDR,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)           
 //SYSIN    DD DSN=TSHRPD.P54IWO.CNTLLIB(CFLMS754),DISP=SHR             
 //*                                                                   
 //SORT01   EXEC PGM=SORT                                               
 //SORTIN   DD DSN=&HDR,DISP=SHR,VOL=REF=*.SORT00.OUT                   
 //         DD DSN=TSHRCI.N548B5.NPTFLIB1.JULY28.SORT,DISP=SHR         
 //         DD DSN=&HDR,DISP=SHR,VOL=REF=*.SORT00.OUT                   
 //         DD DSN=TSHRCI.N548B5.NPTFLIB.AUG26.SORT.T082610,DISP=SHR   
 //SORTOUT  DD  DSN=TSHRCI.N548B5.NPTFLIB.AUG26.SORT1.T082610,         
 //             DISP=(NEW,CATLG,DELETE),UNIT=DISK,                     
 //             SPACE=(CYL,(4,4),RLSE),DCB=*.SORTIN                     
 //SYSIN    DD  *                                                       
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'HDR'),                   
                PUSH=(210:ID=1))                                       
  SORT FIELDS=(31,03,CH,A,34,15,CH,A,1,30,CH,A,210,1,ZD,D)             
  OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(210,1,ZD,EQ,2),PUSH=(211:1,74))     
  OUTFIL INCLUDE=(1,74,CH,NE,211,74,CH),BUILD=(1,209)                   
 //SYSOUT   DD  SYSOUT=*                                               
"Code'd"

When I was trying to exclude this JCL I am getting below error if any body can help for solving this issue
\ . . . . . . . . . . . . . . . . . . . . . . . . . . .
Display Filter View Print Options Help
-------------------------------------------------------------------------------
SDSF OUTPUT DISPLAY P54IWO3D J0056163 DSID 109 LINE 0 COLUMNS 02- 81
COMMAND INPUT ===> SCROLL ===> CSR
********************************* TOP OF DATA **********************************
SYNCSORT FOR Z/OS 1.3.2.1R U.S. PATENTS: 4210961, 5117495 (C) 2007 SYNCSO
MEDCO HEALTH SOLUTIONS, INC z/OS 1.10.
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 79AF1, MODEL 2097 721 LICEN
SYSIN :
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'HDR'),
PUSH=(210:ID=1))
SORT FIELDS=(31,03,CH,A,34,15,CH,A,1,30,CH,A,210,1,ZD,D)
OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(210,1,ZD,EQ,2),PUSH=(211:1,74))
OUTFIL INCLUDE=(1,74,CH,NE,211,74,CH),BUILD=(1,209)
WER276B SYSDIAG= 149894, 8972491, 8972491, 9452775
WER164B 24,612K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 1,012K BYTES USED
WER146B 12K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=FB ; LRECL= 209; BLKSIZE= 27797
WER257I INREC RECORD LENGTH = 210
WER238I POTENTIALLY INEFFICIENT USE OF I
NREC
WER237I OUTREC RECORD LENGTH = 284
WER110I SORTOUT : RECFM=FB ; LRECL= 209; BLKSIZE= 27797


Please let me know if there any solution for this issue.

Regards
Venkat
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: Sun Aug 29, 2010 10:28 am    Post subject:
Reply with quote

Hello,

The job posted is using Syncsort - not DFSORT. This topic has been moved to the JCL part of the forum where Syncsort topics are posted.

You didn't use the Code tag - it makes your posts of terminal data much more readable (i coded part of your previous post). Suggest you learn to do this. It is painless as there is a Preview function. . .

If you are copying records, suggest you correct the lengths so that they are consistent. . .
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Sun Aug 29, 2010 12:03 pm    Post subject:
Reply with quote

You've not shown us the contents of:
Code:
//SYSIN    DD DSN=TSHRPD.P54IWO.CNTLLIB(CFLMS754)
- what is there, please show us that.

On the other hand, your problem looks like a simple file-match thing and possibly two passes of data are not needed. Suggest you also show us the couple of records from both the input-files and the expected output from that. Also, please tell us the rules to get the output along with LRECL and RECFM of input/output.(I asked for LRECL/RECFM because your OUTREC says that output is of LRECL=284 while input is of 209)
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sun Aug 29, 2010 3:41 pm    Post subject:
Reply with quote

at the bottom of your PROFILE
Code:

                                         Quick Reply Options
Show Quick Reply Form:    <<<<<<<<<<<<select yes
Quick Reply Mode    Basic   Advanced  <<<<<<<<select advanced


checking advanced, will provide you with buttons that will insert the proper bbcode format.

otherwise learn bbcode here
Back to top
View user's profile Send private message
gvenkateshmca

New User


Joined: 10 Jul 2008
Posts: 6
Location: 23rdSt-Ely Ave,Long Island city,NY

PostPosted: Sun Aug 29, 2010 6:18 pm    Post subject: Removing matching records from files
Reply with quote

Hi ,

I am giving the below example

File1 :


012223 AAAAAAA VENKATE1
012223 AAAAAAA VENKATE2
012223 AAAAAAA VENKATE3
012223 AAAAAAA VENKATE4


FILE2 :


012223 AAAAAAA VENKATE1
012223 AAAAAAA VENKAT4


The output should be like this


012223 AAAAAAA VENKATE2
012223 AAAAAAA VENKATE3


.The input and out file have same length (i.e 209) ,the sort fileds already present in the previous message.

Regards
Venkat
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: Sun Aug 29, 2010 6:34 pm    Post subject:
Reply with quote

Hellol,

Do not "pick and choose" which requsted info you will post and how you will post it. . .

Why have you not posted the info Anuj requested?
Quote:
the sort fileds already present in the previous message.
Not all of it. You may not believe you need to post this, but when asked to do something so easy, suggest you do as asked.

Why did you not use the code tag? What have you done to correct the length(s)?

I supposed the incorrect data shown is just a typo and we're supposed to work around this?

The way for the forum to be most useful to you is to take care when posting and to do what is asked. . .
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 31, 2010 2:00 am    Post subject: Re: Removing matching records from files
Reply with quote

In File2, I assume
gvenkateshmca wrote:
FILE2 :


012223 AAAAAAA VENKATE1
012223 AAAAAAA VENKAT4
record-2 is
Quote:
012223 AAAAAAA VENKATE4
otherwise it's "not a match in file1" and hsould be written to Output.

Based upon the above assumption, try this:
Code:
 //SYSIN    DD *                           
   JOINKEYS FILES=F1,FIELDS=(1,23,A)       
   JOINKEYS FILES=F2,FIELDS=(1,23,A)       
   JOIN UNPAIRED,F1,ONLY                   
   SORT FIELDS=COPY                       
/*   

However, you might need to extrapolate it to your needs. And if you want something exactly matching to your requirements, suggest you follow the suggestion from Dick.
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 SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 6 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm


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