Page 2 of 2

Re: Getting error by using OUTREC OVERLAY

PostPosted: Tue Jul 02, 2013 6:33 pm
by bodatrinadh
May be you can try either one of these -

Increase the LRECL of your output file to 150.
or
SORT FIELDS=COPY,STOPAFT=1                               
OUTREC OVERLAY=(127:86,19)


or
SORT FIELDS=COPY,STOPAFT=1                               
OUTREC BUILD=(1,4,5,130,131:86,15)


And finally you changed my name to Badinath :D :lol:

Re: Getting error by using OUTREC OVERLAY

PostPosted: Tue Jul 02, 2013 7:18 pm
by porwalrox
Hi bodatrinadh,

I tried both but did'nt work. same abend.

Re: Getting error by using OUTREC OVERLAY

PostPosted: Tue Jul 02, 2013 11:37 pm
by dick scherrer
Hello,

You MUST change the output lrecl to account for the new data . . .

Re: Getting error by using OUTREC OVERLAY

PostPosted: Wed Jul 03, 2013 1:55 pm
by porwalrox
Thanks all of you.

It's clear that we can not overlay some fields for different type of record length. Is there any way from which it can be acheived?

Re: Getting error by using OUTREC OVERLAY

PostPosted: Thu Jul 04, 2013 4:21 am
by BillyBoyo
If you use OVERLAY, the length of the original record will not change, just the data will be rearranged.

If you use BUILD, the length of the record will be that of the fields and constants included in the BUILD, and nothing else.

You cannot possibly get two output records from what you have shown. So, please, instead of just saying "it doesn't work", show us the relevant fields from you input, the output you are obtaining, the full sysout from the step, including all the Sort Control Cards. All in the Code tags to preserve spacing.

Re: Getting error by using OUTREC OVERLAY

PostPosted: Mon Jul 08, 2013 8:09 pm
by porwalrox
Hi BillyBoyo,

First, Sorry for my late reply.

My problem was:
Suppose i have 3 VSAM files F1, F2 and F3. These files F1,F2 is of 145 LRECL and F3 is of 1201.
First i have copied first record from F1 to F2. Now i have to overlay 19 bytes from the first record of F3(starting from position 82 to position 100 from F3 file) to the F2 file(position starting from 127 to 145).

Well, I have done this using SAS and IDCAMS. First i wrote a SAS for these positions then repro that file to the VSAM file.
If I am doing some mistakes in SORT, Please let me know.

Record from F1 looks like this(HEX is on):
--7--- -+----8----+----9----+----0----+----1----+----2----+----3----+----4----+
********************************* TOP OF DATA **********************-CAPS OFF-*
                                                               2013070804422222
000000 00000000000000000000000000000000000000000000000000000079FFFFFFFFFFFFFFFF
000000 0000000000000000000000000000000000000000000000000000068C2013070804493500


Record from F3 looks like this(HEX is on):
-- +----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0-
********************************* TOP OF DATA **********************-CAPS OFF-*
                                                               2013070804493500
00 000000000000000000000000000000000000000000000000000000000079FFFFFFFFFFFFFFFF
00 02020000000000000000000000000000000000000000000000000000068C2013070804493500


Desired output:
Record from F2 looks like this(HEX is on):
--7--- -+----8----+----9----+----0----+----1----+----2----+----3----+----4----+
********************************* TOP OF DATA **********************-CAPS OFF-*
                                                               2013070804493500
000000 00000000000000000000000000000000000000000000000000000079FFFFFFFFFFFFFFFF
000000 0000000000000000000000000000000000000000000000000000068C2013070804493500

Re: Getting error by using OUTREC OVERLAY

PostPosted: Mon Jul 08, 2013 11:06 pm
by BillyBoyo
Are you saying, you want to create a single record on F2, which is mostly the first record from F1, with part of the data coming from F3?

Re: Getting error by using OUTREC OVERLAY

PostPosted: Mon Jul 15, 2013 9:46 pm
by porwalrox
Yes BillyBoyo.

Re: Getting error by using OUTREC OVERLAY

PostPosted: Wed Jul 17, 2013 4:38 am
by BillyBoyo
What you really want can be done with JOINKEYS.

To avoid confusion, we'll call your F2 the output.

You need something which is guaranteed to match on F1 and F3. It looks like the first byte will always be zero, you may choose anything as long as it will make the first records match.

Code up your JOINKEYS, and look at how to put STOPAFT=1 on the JOINKEYS and use the REFORMAT statement to create your output record for F2.