Need a JCL to compare two file



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Need a JCL to compare two file

Postby INDRA » Fri Oct 29, 2010 5:25 pm

Hi,

I need a jcl to compare fileA with FileB and need to eliminate the record that is available in file A from FILE B and write the output in another file.

Input file:
*************
FILE A: 7 Byte length
xxxxxxx
yyyyyyyy

File B: 7000 byte length
header record
xxxxxxx09100110......................................................... etc till 7000 btye
xxxxxxx07100110......................................................... etc till 7000 btye
yyyyyyyy09100110......................................................... etc till 7000 btye
zzzzzzzz09100110......................................................... etc till 7000 btye
aaaaaaa09100110......................................................... etc till 7000 btye
aaaaaaa09100110......................................................... etc till 7000 btye
trailer record with record counts(6)

File C: 7000 byte length (output file)

header - same as File B
zzzzzzzz09100110......................................................... etc till 7000 btye
aaaaaaa09100110......................................................... etc till 7000 btye
aaaaaaa09100110......................................................... etc till 7000 btye
Trailer - with updated record count. (3)

Can any one pleas help me on this?
INDRA
 
Posts: 5
Joined: Fri Oct 29, 2010 4:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need a JCL to compare two file

 

Re: Need a JCL to compare two file

Postby Frank Yaeger » Fri Oct 29, 2010 11:23 pm

What exactly does the trailer record look like? Can it be identified in some way (e.g. TRL in positions 1-3). What is the starting position, length and format of the count to be updated?
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Need a JCL to compare two file

Postby INDRA » Mon Nov 01, 2010 10:32 am

Trailer record contains,

High values in position 1-29 and record count of 10 byte starting from 30-39.
INDRA
 
Posts: 5
Joined: Fri Oct 29, 2010 4:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need a JCL to compare two file

Postby Frank Yaeger » Tue Nov 02, 2010 1:17 am

Here's a DFSORT job that will do what you asked for. I assumed 8 bytes of X'FF's are enough to identify the trailer record.

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/7)
//IN2 DD DSN=...  input file2 (FB/7000)
//OUT DD DSN=...  output file (FB/7000)
//SYSIN DD *
  JOINKEYS F1=IN1,FIELDS=(1,7,A)
  JOINKEYS F2=IN2,FIELDS=(1,7,A)
  JOIN UNPAIRED,F2,ONLY
  REFORMAT FIELDS=(F2:1,7008)
  SORT FIELDS=(7001,8,ZD,A)
  OUTFIL FNAMES=OUT,REMOVECC,
    BUILD=(1,7000),
    TRAILER1=(29X'FF',COUNT-1=(TO=ZD,LENGTH=10))
/*
//JNF2CNTL DD *
  OMIT COND=(1,8,BI,EQ,X'FFFFFFFFFFFFFFFF')
  INREC OVERLAY=(7001:SEQNUM,8,ZD)
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Need a JCL to compare two file

Postby INDRA » Mon Nov 08, 2010 2:24 pm

Hi,

I am getting below JCl error with the above code, Can you please let me know what needs to be corrected?

------------------------------------------------------------------------
E1 8 DSS20011E DD 'SORTIN' WAS NOT ALLOCATED.
E2 8 DSS11051E UNRECOGNIZED 'SORT' KEYWORD 'JOINKEYS'.
E3 8 DSS11051E UNRECOGNIZED 'SORT' KEYWORD 'JOINKEYS'.
E4 8 DSS11051E UNRECOGNIZED 'SORT' KEYWORD 'JOIN'.
E5 8 DSS11051E UNRECOGNIZED 'SORT' KEYWORD 'REFORMAT'.
INDRA
 
Posts: 5
Joined: Fri Oct 29, 2010 4:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need a JCL to compare two file

Postby enrico-sorichetti » Mon Nov 08, 2010 2:35 pm

are You running a jcl checker perchance ?
DSS.... messages are not sort related

jcl checkers are usually out of sync with SORT products

if the only errors You get are Sort parameters related You can happily submit the job
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Need a JCL to compare two file

Postby Frank Yaeger » Tue Nov 09, 2010 12:21 am

INDRA,

Those are messages from a "JCL checker", not regular JCL messages, and they may not be meaningful.

If your job is not executing successfully, post the complete JES log. DFSORT's messages are in //SYSOUT.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Need a JCL to compare two file

Postby INDRA » Thu Nov 11, 2010 6:22 pm

Hi Frank,

Thanks A lot for ur help.

Can u pls help me out in explaning the below lines in the icetool,

JOINKEYS F1=IN1,FIELDS=(1,7,A)
JOINKEYS F2=IN2,FIELDS=(1,7,A)
JOIN UNPAIRED,F2,ONLY
REFORMAT FIELDS=(F2:1,7008)
SORT FIELDS=(7001,8,ZD,A)
OUTFIL FNAMES=OUT,REMOVECC,
BUILD=(1,7000),
TRAILER1=(29X'FF',COUNT-1=(TO=ZD,LENGTH=10))

so that I can write this of myself for any future requirement?
INDRA
 
Posts: 5
Joined: Fri Oct 29, 2010 4:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need a JCL to compare two file

Postby INDRA » Thu Nov 11, 2010 6:26 pm

Trailer record count contain the number of record in file with exclusive of header and trailer. I need the record count with inclusive of both header and trailer
INDRA
 
Posts: 5
Joined: Fri Oct 29, 2010 4:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need a JCL to compare two file

Postby Frank Yaeger » Fri Nov 12, 2010 12:48 am

File C: 7000 byte length (output file)

header - same as File B
zzzzzzzz09100110......................................................... etc till 7000 btye
aaaaaaa09100110......................................................... etc till 7000 btye
aaaaaaa09100110......................................................... etc till 7000 btye
Trailer - with updated record count. (3)

Can any one pleas help me on this?


Trailer record count contain the number of record in file with exclusive of header and trailer. I need the record count with inclusive of both header and trailer


The original example showed a count of only the data records. Now you say you want a count of all of the records? If so, just change COUNT-1 to COUNT+1.

Can u pls help me out in explaning the below lines in the icetool


This job does NOT use ICETOOL. It just uses DFSORT. 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:

http://www.ibm.com/support/docview.wss? ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post