Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Compare Two file of Same LRECL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Meena Chandran

New User


Joined: 28 Dec 2007
Posts: 13
Location: Chennai

PostPosted: Tue Sep 22, 2009 12:35 pm    Post subject: Compare Two file of Same LRECL
Reply with quote

Hi ,

I want to compare two files with same LRECL (150) & file format is FB . The key filed (Jobname) is at different postiions in the both the files.
Could anyone help me on this?

FILE A:
Code:
109/17/2009 07:05:46 Unicenter CA-View Output Archival and Viewing (11.0)
SARBCT Batch Processing Utility - Sysout Archival Listing
0ID Jobname Jobid Gen Seq Arc Date Time Loc Lines Pages Blocks Xcode Tseq DRseq
-------------------------------- -------- -------- ----- ----- ---------- ----- ---- ---------- --------- --------- ------- ------ ----- -----
0$AGYX#NM Jobname1 JOB27854 4706 1 09/17/2009 06:24 DISK 3456 67 252
$AGYXCOM  Jobname4 JOB27875 4706 1 09/17/2009 06:24 DISK 4567 67 345
$APO1RST  Jobname3 JOB26592 4706 1 09/17/2009 06:54 DISK 5678 98 098
FILE B:
Code:
XXX#XXX#X#X#XXXXJobname1 NOEX002Owner XXX#XXX#X#XXXXX XXX 980404
YYY#YYY#Y#Y#YYYYJobname2 NOEX005Owner YYY#YYY#Y#YYYYY YYY 980718
XXX#XXX#X#X#XXXXJobname3 NOEX006Owner XXX#XXX#X#XXXXX XXX 980404
My O/P should be:
Code:
109/17/2009 07:05:46 Unicenter CA-View Output Archival and Viewing (11.0)
SARBCT Batch Processing Utility - Sysout Archival Listing
0ID Jobname Jobid Gen Seq Arc Date Time Loc Lines Pages Blocks Xcode Tseq DRseq
-------------------------------- -------- -------- ----- ----- ---------- ----- ---- ---------- --------- --------- ------- ------ ----- -----
0$AGYX#NM Jobname1 JOB27854 4706 1 09/17/2009 06:24 DISK 3456 67 252
$APO1RST  Jobname3 JOB26592 4706 1 09/17/2009 06:54 DISK 5678 98 098


Thanks,
Back to top
View user's profile Send private message

Meena Chandran

New User


Joined: 28 Dec 2007
Posts: 13
Location: Chennai

PostPosted: Tue Sep 22, 2009 1:26 pm    Post subject:
Reply with quote

Key field is at in file 1: 17 th column to 8 char
in file 2 : 35th column to 8 char


Thanks
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8617
Location: Back in jolly old England

PostPosted: Tue Sep 22, 2009 1:32 pm    Post subject:
Reply with quote

You really do need to provide all of the information for people to be able to help you.

What are the positions, lengths and formats of the key fields.
It looks as though you only require matched records from both files, but you have not stated this.
Also, it looks at though you only want records from file 1, but again you need to state this.
The lines above the actual data, are these for information only or do the exist in file1, and are they required in the output.
Which level of DFSORT are you using, as this can affect the solution quite dramatically. Please post the whole line with message code ICE201I from an output using DFSORT.
Back to top
View user's profile Send private message
Meena Chandran

New User


Joined: 28 Dec 2007
Posts: 13
Location: Chennai

PostPosted: Tue Sep 22, 2009 2:32 pm    Post subject:
Reply with quote

Hi Pat,

Here are the answers:

Key field:

File A:
Key filed: 35-8
File length (LRECL): 150
File Format: FBA
Contains Duplicate records: Yes

File B:

Key filed: 17-8
File length (LRECL): 150
File Format: FBA
Contains Duplicate records: No

Yes I need only Matching records that exist from File A.
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: Tue Sep 22, 2009 7:40 pm    Post subject:
Reply with quote

Hello,

And
Quote:
Which level of DFSORT are you using, as this can affect the solution quite dramatically. Please post the whole line with message code ICE201I from an output using DFSORT.
icon_question.gif
Back to top
View user's profile Send private message
Meena Chandran

New User


Joined: 28 Dec 2007
Posts: 13
Location: Chennai

PostPosted: Tue Sep 22, 2009 8:36 pm    Post subject:
Reply with quote

It's

'ICE201I F RECORD TYPE IS F - DATA STARTS IN POSITION 1 '
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Sep 22, 2009 11:34 pm    Post subject: Reply to: Compare Two file of Same LRECL
Reply with quote

meena chandran,

The following DFSORT/ICETOOL JCl will give you the desired results. I assumed that only the first 4 lines in your FILEA which has the duplicates are the header records

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                                 
//SORTOUT  DD DSN=&&HDR,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)     
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                             
  OUTFIL REMOVECC,NODETAIL,BUILD=(150X),HEADER1=('HDR')         
/*                                                             
//STEP0200 EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG   DD SYSOUT=*                                         
//IN       DD DSN=&&HDR,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT     
//         DD DSN=your unique jobname file,DISP=SHR
//         DD DSN=&&HDR,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT     
//         DD DSN=your duplicate jobname file,DISP=SHR
//OUT      DD SYSOUT=*                                         
//TOOLIN   DD *                                                 
  SPLICE FROM(IN) TO(OUT) ON(167,8,CH) WITH(176,1) -           
  WITHALL KEEPNODUPS USING(CTL1)                               
//CTL1CNTL DD *                                                 
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(151:SEQNUM,8,ZD,16X)),       
  IFTHEN=(WHEN=(1,3,CH,EQ,C'HDR'),OVERLAY=(151:SEQNUM,8,ZD)),   
  IFTHEN=(WHEN=(1,3,CH,NE,C'HDR'),OVERLAY=(159:SEQNUM,8,ZD,     
  151:151,8,ZD,SUB,159,8,ZD,M11,LENGTH=8),HIT=NEXT),           
  IFTHEN=(WHEN=(151,8,ZD,EQ,1),OVERLAY=(167:17,8,C'11')),       
  IFTHEN=(WHEN=(151,8,ZD,EQ,2),OVERLAY=(159:SEQNUM,8,ZD,       
           167:35,8,C'22'),HIT=NEXT),                           
  IFTHEN=(WHEN=(151,8,ZD,EQ,2,AND,159,8,ZD,LE,4),               
  OVERLAY=(167:7X,SEQNUM,1,ZD))                                 
  OUTFIL FNAMES=OUT,BUILD=(1,150),                             
  INCLUDE=(175,2,ZD,EQ,12,OR,(151,8,ZD,EQ,2,AND,159,8,ZD,LE,4)) 
//*
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us