MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

file aid batch jcl for comparing 2 datasets

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
chandra_vssv
Beginner


Joined: 08 May 2005
Posts: 26
Topics: 12
Location: pune

PostPosted: Fri May 13, 2005 11:57 am    Post subject: file aid batch jcl for comparing 2 datasets Reply with quote

Hi,

I am comparing two datasets using file aid batch jcl.
FILEA AND FILEB, FILEA contains only account numbers (unique)and FILEB contains account numbers and details .it also contains duplicate account numbers.if FILEB acct numbers matches with FILEA ,write the complete record of FILEB to o/p file.As FILEB contains duplicte account numbers, but o/p i'm not getting duplicate ones.Could anyone please suggest, how can i get duplictes also. is there any parameter i have to add in control card.In output i need duplicate account numbers also that are in FILEB

and the JCL and Control Cards i'm using are
Code:

//xx6512B JOB (ACCOUNT),'NAME',CLASS=X,MSGCLASS=Y,NOTIFY=&SYSUID

//FASTEP EXEC PGM=FILEAID,REGION=6M
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*,DCB=(LRECL=183,BLKSIZE=1830)
//DD01 DD DSN=FILEA,
// UNIT=SYSDA,
// DISP=SHR
//DD01C DD DSN=FILEB,
// UNIT=SYSDA,
// DISP=SHR,
// DCB=(RECFM=VB,LRECL=1084,BLKSIZE=27998)
//DD01CO3 DD DSN=OUTPUT2, 0000000
// UNIT=SYSDA, 0000000
// DISP=OLD,
// DCB=(RECFM=VB,LRECL=1084,BLKSIZE=27998)
//DD01CP DD DSN=COMPARE.CTC,
// DISP=OLD
//DD01SC DD DSN=FILEAID.SC.CTC,
// DISP=OLD
//DD01SCN DD DSN=FILEAID.SC.CTC1,
// DISP=OLD
//SYSIN DD *
$$DD01 COMPARE
/*
//

CONTROL CARDS

*
* COMPARE OPTIONS
0000 COMPARE_MODE=UNFORMATTED
0000 COMPARE_TYPE=READ_AHEAD
0000 READ_AHEAD_COUNT=100
0000 READ_AHEAD_SEQUENCE=IGNORE
0000 RECORDS_TO_COMPARE=ALL
0000 DIFFERENCES_TO_COMPARE=ALL
*
* PRINT OPTIONS
0000 PRINT_FORMAT=CHAR
0000 MAX_DIFFERENCES_TO_REPORT=ALL
0000 RECORD_TYPES_TO_PRINT=CHANGED,DELETED,INSERTED
0000 UNFORMATTED_REPORT_STYLE=CONDENSED
0000 UNFORMATTED_PRINT_SEQUENCE=GROUP
0000 CHANGED_RECORD_PRINT_CONTENT=RECORD
0000 INSERTED_RECORD_PRINT_CONTENT=RECORD
0000 DELETED_RECORD_PRINT_CONTENT=RECORD
0000 MATCHED_RECORD_PRINT_CONTENT=SYNC/KEY
0000 CONDENSED_REPORT_PRINT_ONLY_CHANGED_DATA=NO
0000 CONDENSED_REPORT_UNDERLINE_CHANGES=BOTH
0000 CONDENSED_REPORT_UNDERLINE_SYNC/KEY=BOTH
0000 CONDENSED_REPORT_SUPPRESS_PRINT_WITHOUT_CHANGES=YES
0000 CONDENSED_REPORT_PRINT_RULER=TOP
0000 CONDENSED_REPORT_CHANGED_DATA_UNDERLINE_CHARACTER=_
0000 CONDENSED_REPORT_SYNC/KEY_UNDERLINE_CHARACTER=
*
* OUTPUT OPTIONS
0000 WRITE_TO_FILE_3=NEW/MATCHED
* NOT SPECIFIED
*
* SYNC/KEY OPTIONS
0000 SYNC/KEY001:OLD_POSITION=00001,OLD_LENGTH=00013,OLD_DATA_TYPE=C,
SORTED=NO,
NEW_POSITION=00008,NEW_LENGTH=00013,NEW_DATA_TYPE=C
*
* COMPARE FIELDS SET 0001
0001 FIELD0002:OLD_POSITION=00001,OLD_LENGTH=00013,OLD_DATA_TYPE=C,
NEW_POSITION=00008,NEW_LENGTH=00013,NEW_DATA_TYPE=C


SC

DEFINE BLOCKS=SELECTION,

INITIAL_SKIP=0,
THEN_SELECT=1,
THEN_SKIP=0,

MAXIMUM_TO_SEARCH=ALL,
MAXIMUM_TO_SELECT=ALL
===========================================
SCN

DEFINE BLOCKS=SELECTION,

INITIAL_SKIP=0,
THEN_SELECT=1,
THEN_SKIP=0,

MAXIMUM_TO_SEARCH=ALL,
MAXIMUM_TO_SELECT=ALL


===============================================
FILEA IS OLD FILE
FILEB IS NEW FILE

===================================
this is the sample input and output data

old

2169960002002
248M600001001
262R080001262
4216996000200
7656445483322
8475908806208
8477490090553

new
00000000000000000000
00000012169260002002 ID
50000012169930002002 IM
00000042169960002002 BS
00000052169960002002 MO
00000032169960002002 01
00000042169960002002 BS
00000052169960002002 MO
50000012169960002002 IM
50000022169960002002 IC
000000621699699999999999999999999CO
0000001248M600001001 ID
0000003248M600001001 01
0000004248M600001001 BS
0000005248M600001001 MO
0000001248M600004004 ID
0000003248M600004004 01

output i'm getting was

00000042169960002002 BS
0000001248M600001001 ID

_________________
Regards,
Chandu
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri May 13, 2005 12:43 pm    Post subject: Reply with quote

chandra_vssv,

your input file is a VB file , so did you consider the rdw when comparing the fields? anyway try this compare options.

Code:

*   COMPARE OPTIONS                                                   
0000 COMPARE_MODE=UNFORMATTED                                         
0000 COMPARE_TYPE=SORTED                                             
0000 RECORDS_TO_COMPARE=ALL                                           
0000 DIFFERENCES_TO_COMPARE=ALL                                       
*                                                                     
*   PRINT OPTIONS                                                     
0000 PRINT_FORMAT=CHAR                                               
0000 MAX_DIFFERENCES_TO_REPORT=ALL                                   
0000 RECORD_TYPES_TO_PRINT=DELETED,INSERTED                           
0000 UNFORMATTED_REPORT_STYLE=CONDENSED                               
0000 UNFORMATTED_PRINT_SEQUENCE=GROUP                                 
0000 CHANGED_RECORD_PRINT_CONTENT=RECORD                             
0000 INSERTED_RECORD_PRINT_CONTENT=RECORD                             
0000 DELETED_RECORD_PRINT_CONTENT=RECORD                             
0000 MATCHED_RECORD_PRINT_CONTENT=RECORD                             
0000 CONDENSED_REPORT_PRINT_ONLY_CHANGED_DATA=NO                     
0000 CONDENSED_REPORT_UNDERLINE_CHANGES=BOTH                         
0000 CONDENSED_REPORT_UNDERLINE_SYNC/KEY=BOTH                         
0000 CONDENSED_REPORT_SUPPRESS_PRINT_WITHOUT_CHANGES=YES             
0000 CONDENSED_REPORT_PRINT_RULER=TOP                                 
0000 CONDENSED_REPORT_CHANGED_DATA_UNDERLINE_CHARACTER=_             
0000 CONDENSED_REPORT_SYNC/KEY_UNDERLINE_CHARACTER=                   
*                                                                     
*   OUTPUT OPTIONS                                                   
*   NOT SPECIFIED                                                     
*                                                                     
*   SYNC/KEY OPTIONS                                                 
0000 SYNC/KEY001:OLD_POSITION=00005,OLD_LENGTH=00013,OLD_DATA_TYPE=C,
                 SORTED=YES,SEQUENCE=ASCENDING,                       
                 NEW_POSITION=00012,NEW_LENGTH=00013,NEW_DATA_TYPE=C 
*                                                                     
*   COMPARE FIELDS SET 0001                                           
COMPARE FUNCTION PROCESSING FOR DD01 HAS ENDED                       
                                                                     



Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group