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

Remove duplicates from VB file and write into FB file using


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Krishnadeva Reddy

New User


Joined: 14 Nov 2007
Posts: 37
Location: Chennai

PostPosted: Sat Jul 09, 2011 12:15 am
Reply with quote

Hello,

I have a input file with Variable length and it contains records in the following manner:

First 7 bytes is record type and next 14 bytes is key

Code:

HEADER1
A000010123456A0000010
B000010123456A0000010
C000010123456A0000010
A000010123456A0000011
B000010123456A0000011
C000010123456A0000011
TRAILER1
HEADER2
A000010123456A0000012
B000010123456A0000012
C000010123456A0000012
A000010123456A0000010
B000010123456A0000010
C000010123456A0000010
TRAILER2


I'm trying to write duplicate records into SORTXSUM dataset (FB) using below JCL, but its giving error with user abned U0016 and the error message is also shown below:

Code:

//SORT01   EXEC  PGM=SORT                                             
//SORTIN   DD DSN=GDGT.TEST.INPUT.G0024V00,DISP=SHR           
//SORTOUT  DD DSN=TEST.OUT1.UNQRCD,                       
//            DISP=(,CATLG,CATLG),                     
//            SPACE=(CYL,(1,1),RLSE),UNIT=(SYSDA,8)                   
//SORTXSUM DD DSN=TEST.OUT2.DUPRCD,                       
//            DISP=(,CATLG,CATLG),                   
//            SPACE=(CYL,(1,1),RLSE),UNIT=(SYSDA,8)                   
//SYSIN    DD *                                                       
   SORT FIELDS=(1,80,CH,A)                                             
   OUTFIL FNAMES=SORTOUT,OUTREC=(1:5,7,8:20,14,22:59C' '),CONVERT     
   INCLUDE COND=(5,7,CH,EQ,C'A000010')                                 
   SUM  FIELDS=NONE,XSUM                                               
   OUTFIL FNAMES=SORTXSUM,OUTREC=(1:5,7,8:20,14,22:59C' '),CONVERT     
//SYSOUT      DD SYSOUT=*                                       


Error message:
Code:

SYSIN :                                                           
   SORT FIELDS=(1,80,CH,A)                                         
   OUTFIL FNAMES=SORTOUT,OUTREC=(1:5,7,8:20,14,22:59C' '),CONVERT 
   INCLUDE COND=(5,7,CH,EQ,C'A000010')                             
   SUM  FIELDS=NONE,XSUM                                           
   OUTFIL FNAMES=SORTXSUM,OUTREC=(1:5,7,8:20,14,22:59C' '),CONVERT
WER202A  SORTXSUM RECFM INCOMPATIBLE                               


Could any of you please help me out to get the duplicates in SORTXSUM dataset and unique records in SORTOUT dataset. Output files are FB and Input file is VB.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Sat Jul 09, 2011 1:50 am
Reply with quote

Krishna, I cleaned up your original JCL to make it look at least somewhat right for a SORT job. Now, I don't have access to Syncsort manuals, but I'd think that first, you'd need to change your SORT statement so that you're not including the RDW of your VB dataset in the sort. It should probably be:

SORT FIELDS=(5,80,CH,A)

as far as SORTXSUM, maybe you should try letting the product determine what the output should look like, and see what it does.
Back to top
View user's profile Send private message
Krishnadeva Reddy

New User


Joined: 14 Nov 2007
Posts: 37
Location: Chennai

PostPosted: Mon Jul 11, 2011 6:56 pm
Reply with quote

Thanks superK.

I have changed the SORT condition to SORT FIELDS=(20,14,CH,A)
to sort based on the key values and identify duplicate keys.

Code:

//SORT01   EXEC  PGM=SORT                                             
//SORTIN   DD DSN=GDGT.TEST.INPUT.G0024V00,DISP=SHR           
//SORTOUT  DD DSN=TEST.OUT1.UNQRCD,                       
//            DISP=(,CATLG,CATLG),                     
//            SPACE=(CYL,(1,1),RLSE),UNIT=(SYSDA,8)                   
//SORTXSUM DD DSN=TEST.OUT2.DUPRCD,                       
//            DISP=(,CATLG,CATLG),                   
//            SPACE=(CYL,(1,1),RLSE),UNIT=(SYSDA,8)                   
//SYSIN    DD *                                                       
   SORT FIELDS=(20,14,CH,A)                                             
   OUTFIL FNAMES=SORTOUT,OUTREC=(1:5,7,8:20,14,22:59C' '),CONVERT     
   INCLUDE COND=(5,7,CH,EQ,C'A000010')                                 
   SUM  FIELDS=NONE,XSUM                                               
   OUTFIL FNAMES=SORTXSUM,OUTREC=(1:5,7,8:20,14,22:59C' '),CONVERT     
//SYSOUT      DD SYSOUT=*                                       


Still trying, no luck.
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: Mon Jul 11, 2011 8:06 pm
Reply with quote

Hello,

Once again, a basically wasted iteration. . .

DO NOT POST "It didn't work". . . . icon_sad.gif

Why did you not post the diagnostic information generated by the most recent run?
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top