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

how to compare 2 files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Rambhupalchowdary

New User


Joined: 19 Aug 2010
Posts: 47
Location: Hyderabad

PostPosted: Wed Oct 27, 2010 10:05 pm
Reply with quote

Hi,

We have two files, file one is having 5 bytes in that first 4 bytes are company code.

Second file is having 34 bytes lenght and first 4 bytes are having company codes.

I want out put file same format as second file for the matching company codes in first file.


Thanks

Ram
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Oct 27, 2010 10:12 pm
Reply with quote

I had the same situation not too long ago.

What I did was a search on the forum for JOINKEYS.

There were many examples to choose from.

What I did next was:

Used my brain and figured it out for myself.

Boy does it feel good to do that rather than "I want".
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Oct 27, 2010 10:31 pm
Reply with quote

Ram,

If you need more specific help on this:

Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.

Also, run this job and show the //SYSOUT messages you receive, so I can see what level you're at:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DUMMY
//SYSIN    DD    *
    OPTION COPY
/*
Back to top
View user's profile Send private message
Rambhupalchowdary

New User


Joined: 19 Aug 2010
Posts: 47
Location: Hyderabad

PostPosted: Wed Oct 27, 2010 10:43 pm
Reply with quote

Hi Frank,

Please find below msgs form spool in sysout

ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 13:10 ON WED OC
OPTION COPY
ICE201I F RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K47561 C6-K90014 C7-K45047 C8-K46331 E9-K47759 C9-BASE E5-K46178
ICE193I 0 ICEAM1 INVOCATION ENVIRONMENT IN EFFECT - ICEAM1 ENVIRONMENT SELECTED
ICE088I 0 TJ1ADHOC.S1 . , INPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,
ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ERE
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=FULL ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=
ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=
ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE ,EXITC
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMI
ICE235I 0 OPTIONS: NULLOUT=RC0
ICE084I 0 BSAM ACCESS METHOD USED FOR SORTOUT
ICE084I 0 BSAM ACCESS METHOD USED FOR SORTIN
ICE751I 1 EF-BASE F0-BASE E8-K44564
ICE090I 0 OUTPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
ICE055I 0 INSERT 0, DELETE 0
ICE054I 0 RECORDS - IN: 1, OUT: 1
ICE052I 0 END OF DFSORT

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

New User


Joined: 19 Aug 2010
Posts: 47
Location: Hyderabad

PostPosted: Wed Oct 27, 2010 10:46 pm
Reply with quote

Frank,

i tried to use joinkeys, it is giving error. i guess i dont have latest sort version i our shop.
below is jcl i used.

//STEP05 EXEC PGM=SORT
//SORTJNF1 DD DSN=VDENDUK.TEST.COMPANY.LIST,DISP=SHR
//SORTJNF2 DD DSN=VDENDUK.DJ1.PAYTECH.PAYMAST.DETAILS,DISP=SHR
//SORTOUT DD DSN=RKAKARL.OUTPFIL.TEST,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(5,5),RLSE)
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(1,4,A)
JOINKEYS FILES=F2,FIELDS=(1,4,A)
JOIN UNPAIRED,F2,ONLY
SORT FIELDS=COPY
//SYSOUT DD SYSOUT=*
//*

is it possible to do using splice in icetool.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Oct 27, 2010 10:51 pm
Reply with quote

Quote:
i guess i dont have latest sort version i our shop.


You're quite a bit behind in your level of DFSORT. Ask your System Programmer to install z/OS DFSORT PTF UK90025 (Oct, 2010). That will get you up-to-date.

Quote:
is it possible to do using splice in icetool.


I don't know since you still haven't explained clearly what you're trying to do.

Again:

Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
Back to top
View user's profile Send private message
Rambhupalchowdary

New User


Joined: 19 Aug 2010
Posts: 47
Location: Hyderabad

PostPosted: Wed Oct 27, 2010 11:11 pm
Reply with quote

Hi Frank,

Please find below details.

File-1 4 bytes length

CLSL
NAKU

File-2 80 bytes length

CLSL RAM
BACD SHAM
NAKU TONY

OUTPUTFILE:-

CLSL RAM
NAKU TONY

Hope this is fine.Please let me know if you require any furtehr info.

Thanks,
Ram.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Oct 27, 2010 11:26 pm
Reply with quote

Since you don't have the JOINKEYS PTF, you can use a DFSORT/ICETOOL job like the following instead (I'm assuming you don't have duplicates within file1 or within file2 since you didn't show them in your example):

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/4)
//IN2 DD DSN=...  input file2 (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/80)
//TOOLIN DD *
COPY FROM(IN2) TO(T1)
COPY FROM(IN1) TO(T1) USING(CTL1)
SELECT FROM(T1) TO(OUT) ON(1,4,CH) FIRSTDUP
/*
//CTL1CNTL DD *
  INREC OVERLAY=(80:X)
/*
Back to top
View user's profile Send private message
Rambhupalchowdary

New User


Joined: 19 Aug 2010
Posts: 47
Location: Hyderabad

PostPosted: Wed Oct 27, 2010 11:37 pm
Reply with quote

Hi Frank,

I am sorry, i forgot to say. I have few duplicate records in second file.

I want to get all these records in output file.

eg:-
File-1 4 bytes length

CLSL
NAKU

File-2 80 bytes length

CLSL RAM
CLSL TOM
CLSL Marry
BACD SHAM
NAKU TONY

OUTPUTFILE:-

CLSL RAM
CLSL TOM
CLSL Marry
NAKU TONY

Thanks in advance.
Ram.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Oct 28, 2010 1:59 am
Reply with quote

Here's a DFSORT/ICETOOL job for that:

Code:

//S2    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/4)
//IN2 DD DSN=...  input file2 (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/80)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,4,CH) WITHALL -
 WITH(1,81) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:C'BB')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(81:C'VV')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(81,1,CH,EQ,C'VB'),
    BUILD=(1,80)
/*
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top