Frank,
Code the new-field in the old copybook too and use the keyword
IGNORETB=YES which would ignore the trailing blanks in character fields.
So if your new-field has all blanks then file-manager would ignore that
records but if it has anything other than space it would list as mismatch.
01 CCMASTR-OLD.
05 COMPARE-1 PIC X(159).
05 IGNORE-1 PIC X(5).
05 COMPARE-2 PIC X(222).
05 DUMMY-FLD PIC X(17). << pad field
01 CCMASTR-NEW.
05 COMPARE-1 PIC X(159).
05 IGNORE-A PIC X(5).
05 COMPARE-2 PIC X(222).
05 DUMMY-FLD PIC X(17).
Here are the control cards for comparing.
$$FILEM DSM TYPE=FORMATTED,
$$FILEM SYNCH=ONETOONE,
$$FILEM MAP=MAPPED,
$$FILEM IGNORETB=YES,
$$FILEM TCNEW=DVFJS.OLD.COPY(CCMASTR),
$$FILEM TCNEW=DVFJS.NEW.COPY(CCMASTR),
$$FILEM LIST=LONG,
$$FILEM EXCLUDE=(,,,MATCHED),
$$FILEM WIDE=YES,
$$FILEM HILIGHT=YES
Further if you have any questions please let me know
Thanks,
Kolusu
IBM Mainframe Discussion List <[email protected]> wrote on
07/01/2015 02:09:41 PM:
> From: Frank Swarbrick <[email protected]>
> To: [email protected]
> Date: 07/01/2015 02:10 PM
> Subject: Re: FILEM DSM compare question
> Sent by: IBM Mainframe Discussion List <[email protected]>
>
> Thanks, Kolusu. This works. Not at all intuitive to me, but it works.
>
> Still one more. The old record is 386 bytes, while the new one is
> 403. I want it to compare the fields by essentially extending
> (implictly) the old record to be padded with spaces. This way a
> record that is different only in that the new record has 17
> additional spaces at the end would be 'matched'. On the other hand
> if anything in the 'new' 17 characters is not spaces it would be
unmatched.
>
> Thanks!
> Frank
>
> > Date: Tue, 30 Jun 2015 17:15:00 -0700
> > From: [email protected]
> > Subject: Re: FILEM DSM compare question
> > To: [email protected]
> >
> > Frank,
> >
> > You don't have to list the names of the fields to compare. Make the
> > fields you want to compare COMMON in both Copy books and the others
can be
> > any names. In your case you have compare-1 and compare-2 fields in
common
> > and I believe those are the fields you want to compare. Since you want
to
> > exclude ignore-1 field from comparison, just rename the ignore-1 to
some
> > other name in the new copybook. I chose Ignore-A
> >
> > 01 CCMASTR-OLD.
> > 05 COMPARE-1 PIC X(159).
> > 05 IGNORE-1 PIC X(5).
> > 05 COMPARE-2 PIC X(222).
> >
> > 01 CCMASTR-NEW.
> > 05 COMPARE-1 PIC X(159).
> > 05 IGNORE-A PIC X(5). << diff name
> > 05 COMPARE-2 PIC X(222).
> > 05 IGNORE-NEW PIC X(17).
> >
> >
> > Now you can use the following Control cards
> >
> > $$FILEM DSM TYPE=FORMATTED,
> > $$FILEM SYNCH=ONETOONE,
> > $$FILEM MAP=MAPPED,
> > $$FILEM TCNEW=DVFJS.OLD.COPY(CCMASTR),
> > $$FILEM TCNEW=DVFJS.NEW.COPY(CCMASTR),
> > $$FILEM LIST=LONG,
> > $$FILEM EXCLUDE=(,,,MATCHED),
> > $$FILEM WIDE=YES,
> > $$FILEM HILIGHT=YES
> >
> > And you get the desired results.
> >
> > Hope this helps...
> >
> > Kolusu
> > IBM Mainframe Discussion List <[email protected]> wrote on
> > 06/30/2015 04:32:29 PM:
> >
> > > From: Frank Swarbrick <[email protected]>
> > > To: [email protected]
> > > Date: 06/30/2015 04:32 PM
> > > Subject: Re: FILEM DSM compare question
> > > Sent by: IBM Mainframe Discussion List <[email protected]>
> > >
> > > So this is what I have:
> > >
> > > 01 CCMASTR-OLD.
> > > 05 COMPARE-1 PIC X(159).
> > > 05 IGNORE-1 PIC X(5).
> > > 05 COMPARE-2 PIC X(222).
> > >
> > > 01 CCMASTR-NEW.
> > > 05 COMPARE-1 PIC X(159).
> > > 05 IGNORE-1 PIC X(5).
> > > 05 COMPARE-2 PIC X(222).
> > > 05 IGNORE-NEW PIC X(17).
> > >
> > > $$FILEM TCNEW=DVFJS.OLD.COPY(CCMASTR),
> > > $$FILEM TCNEW=DVFJS.NEW.COPY(CCMASTR),
> > > $$FILEM FIELDOLD=(COMPARE-1,COMPARE-2),
> > > $$FILEM FIELDNEW=(COMPARE-1,COMPARE-2),
> > >
> > > This works fine, but it would have been simpler if I could have used
> > > the actual copybook and told FM which fields to ignore, rather than
> > > which fields to utilize. Did I miss some option for this?
> > > Something like this (assuming the copybook above):
> > >
> > > $$FILEM IGNOREOLD=(IGNORE-1),
> > > $$FILEM IGNORENEW=(IGNORE-1,IGNORE-NEW),
> > >
> > > Frank
> > >
> > > > Date: Tue, 30 Jun 2015 13:05:28 -0700
> > > > From: [email protected]
> > > > Subject: Re: FILEM DSM compare question
> > > > To: [email protected]
> > > >
> > > > Frank,
> > > >
> > > > Here is sample File Manager JCL which will compare the 2 vsam
files.
> > The
> > > > old vsam in my case had an lrecl of 612 and the new vsam had an
lrecl
> > of
> > > > 615.
> > > >
> > > > You need to use templates to compare datasets with 2 different
lrecl.
> > so
> > > > create a pds members(see below for samples) with the mapping of
the
> > fields
> > > > you want to compare. I had a cobol copybook which I used.
> > > >
> > > > //STEP0100 EXEC PGM=FILEMGR
> > > > //SYSPRINT DD SYSOUT=*
> > > > //DDOLD DD DISP=SHR,DSN=Your Old VSAM Cluster
> > > > //DDNEW DD DISP=SHR,DSN=Your New VSAM Cluster
> > > > //SYSIN DD *
> > > > $$FILEM DSM TYPE=FORMATTED,
> > > > $$FILEM SYNCH=ONETOONE,
> > > > $$FILEM MAP=MAPPED,
> > > > $$FILEM TCOLD=FRANK.PDS.MAP(SWA1),
> > > > $$FILEM TCNEW=FRANK.PDS.MAP(SWA2),
> > > > $$FILEM FIELDOLD=OLD-REC,
> > > > $$FILEM FIELDNEW=NEW-REC,
> > > > $$FILEM LIST=LONG,
> > > > $$FILEM EXCLUDE=MATCHED,
> > > > $$FILEM WIDE=YES,
> > > > $$FILEM HILIGHT=YES
> > > > //*
> > > >
> > > > The contents of FRANK.PDS.MAP(SWA1)
> > > >
> > > > ----+----1----+----2----+----3----+----4----+-
> > > > 01 DATA-REC.
> > > > 05 OLD-REC PIC X(612).
> > > >
> > > >
> > > > The contents of FRANK.PDS.MAP(SWA2)
> > > >
> > > > ----+----1----+----2----+----3----+----4----+----5
> > > > 01 DATA-REC.
> > > > 05 NEW-REC PIC X(612).
> > > > 05 NEW-FLD PIC X(003).
> > > >
> > > > and Just for the record, DFSORT job to do the same comparison and
much
> >
> > > > more efficient than File manager job.
> > > >
> > > > //STEP0100 EXEC PGM=SORT
> > > > //SYSOUT DD SYSOUT=*
> > > > //INA DD DISP=SHR,DSN=Your Old VSAM Cluster
> > > > //INB DD DISP=SHR,DSN=Your New VSAM Cluster
> > > > //SORTOUT DD SYSOUT=*
> > > > //SYSIN DD *
> > > > OPTION COPY
> > > > JOINKEYS F1=INA,FIELDS=(1,612,A),TYPE=F
> > > > JOINKEYS F2=INB,FIELDS=(1,612,A),TYPE=F
> > > > REFORMAT FIELDS=(F1:1,612,?,F2:1,612)
> > > > JOIN UNPAIRED
> > > > OMIT COND=(613,1,CH,EQ,C'B')
> > > > INREC IFOUTLEN=620,
> > > > IFTHEN=(WHEN=(613,1,CH,EQ,C'1'),BUILD=(C'OLD-REC ',001,612)),
> > > > IFTHEN=(WHEN=(613,1,CH,EQ,C'2'),BUILD=(C'NEW-REC ',614,612))
> > > > //*
> > > >
> > > >
> > > > Hope this helps...
> > > > Kolusu
> > > >
> > > >
> > > >
> > > > From: Frank Swarbrick <[email protected]>
> > > > To: [email protected]
> > > > Date: 06/30/2015 10:08 AM
> > > > Subject: Re: FILEM DSM compare question
> > > > Sent by: IBM Mainframe Discussion List
> > <[email protected]>
> > > >
> > > >
> > > >
> > > > I'm not copying anything. I am trying to compare two files, where
one
> > is
> > > > the old version of the file and one is the new version, with
> > > >
> > > > Take the following two examples
> > > > OLD: (0012)1234AAAABBBB
> > > > NEW: (0016)1234AAAABBBB____
> > > > OLD: (0012)1235AAAABBBB
> > > > NEW: (0016)1235AAAABBBBABCD
> > > >
> > > >
> > > > The numbers in parenthesis are the lengths of the records and are
not
> > part
> > > > of the record. The underscores represents blank spaces. The
first
> > four
> > > > bytes of each record is the key.
> > > >
> > > > I want to do a compare so that for record 1234 they would be
> > considered to
> > > > be equal, but record 1235 would be considered changed.
> > > >
> > > > > Date: Tue, 30 Jun 2015 01:03:21 -0500
> > > > > From: [email protected]
> > > > > Subject: Re: FILEM DSM compare question
> > > > > To: [email protected]
> > > > >
> > > > > Frank Swarbrick wrote:
> > > > >
> > > > > >I know we have some DFSORT experts here. I'm hoping we also
have
> > some
> > > > File Manager experts.
> > > > >
> > > > > I know DFSORT and ICETOOL, but like you I also ask questions on
> > IBM-MAIN
> > > > too ;-), but I don't know File Manager...
> > > > >
> > > > > >I have a KSDS where I am adding a new field, and thus
increasing
> > the
> > > > length of each record. I want to do a compare but only show the
field
> > as
> > > > being "not equal" if the newly added characters are not spaces.
But I
> > do
> > > > want to show them as being not equal if the newly added characters
are
> >
> > > > other than spaces.
> > > > >
> > > > > Ok, lets see - you added some characters (not spaces) to new
column
> > x-y
> > > > using some utility.
> > > > >
> > > > > Do you want to search all 'short' and 'long' records? Or do you
copy
> >
> > > > only 'long' records and then search them only?
> > > > >
> > > > > Something like this INCLUDE=(<first column>,<how many
> > > > characters>,CH,NE,C' ') ?
> > > > >
> > > > > Or something like this - one possible way to split up your
records
> > in
> > > > two separate outputs?
> > > > >
> > > > > (for this example, your new field is starting at column 100 and
is
> > 10
> > > > chars long, no variations in position and length)
> > > > >
> > > > > OUTFILE FNAMES=SPACES,INCLUDE=(100,10,CH,EQ,C' ')
> > > > > OUTFILE FNAMES=NOSPACE,INCLUDE=(100,10,1,CH,NE,C' ')
> > > > >
> > > > > Or do you want to show if a space is appearing at all? In other
> > words,
> > > > do you want to pick up a record with at least one space character
in
> > your
> > > > new field? If so, the SS statement is a great help for that.
> > > > >
> > > > > Or am I missing something?
> > > > >
> > > > > Groete / Greetings
> > > > > Elardus Engelbrecht
> > > > >
> > > > >
> > ----------------------------------------------------------------------
> > > > > For IBM-MAIN subscribe / signoff / archive access instructions,
> > > > > send email to [email protected] with the message: INFO
> > IBM-MAIN
> > > >
> > > >
----------------------------------------------------------------------
> > > > For IBM-MAIN subscribe / signoff / archive access instructions,
> > > > send email to [email protected] with the message: INFO
IBM-MAIN
> > > >
> > > >
> > > >
> > > >
----------------------------------------------------------------------
> > > > For IBM-MAIN subscribe / signoff / archive access instructions,
> > > > send email to [email protected] with the message: INFO
IBM-MAIN
> > >
> > >
----------------------------------------------------------------------
> > > For IBM-MAIN subscribe / signoff / archive access instructions,
> > > send email to [email protected] with the message: INFO
IBM-MAIN
> > >
> >
> > ----------------------------------------------------------------------
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> > send email to [email protected] with the message: INFO IBM-MAIN
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN