Peter,

another way is to run a "DUMMY" JOIN of SORTIN02 with itself specifying
SORTED.

The result will be something like:

WER485A  F2       OUT OF SEQUENCE, RECORD NUMBER = n

Remember to avoid coding OMIT/INCLUDE using JNFxCNTL because this way SS
won't give you the record number (eventually do it in a previous step).
For instance:

//ST020    EXEC  PGM=SORT

//SYSOUT    DD   SYSOUT=*

//F1       DD *

01

05

02

11

/*

//F2       DD *

01

05

02

11

/*

//SORTOUT  DD SYSOUT=*

//SYSIN     DD   *

 JOINKEYS F1=F1,FIELDS=(1,2,CH,A),SORTED

 JOINKEYS F2=F2,FIELDS=(1,2,CH,A),SORTED

 REFORMAT FIELDS=(F1:1,80)

 SORT FIELDS=COPY

/*

will give you:
WER485A  F2       OUT OF SEQUENCE, RECORD NUMBER = 3

Best regards.
Max

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Mail
priva di virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Il giorno mer 31 mar 2021 alle ore 06:58 Massimo Biancucci <
[email protected]> ha scritto:

> Peter,
>
> I don't know if you need a "general" solution or a way to diagnose the
> specific problem.
>
> WER068A tells you that the out of sequence record is on SORTIN02 (first
> tip) and specifically on block 56,917 (second tip).
> Depending on the block size of your file you could "point to the block"
> and then on the group of records and have a closer look.
> Given the SORTIN02 you could copy the dataset to a RECFM=F (or V) but not
> BLOCKED temporary dataset in order to have exactly the offending record
> (BLOCK#=REC#).
> It's not so efficient, anyway we're talking about diagnosing a problem.
>
> Hope this helps.
> Best regards.
> Max
>
>
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
>  Mail
> priva di virus. www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
> <#m_-7096681244659233946_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> Il giorno mar 30 mar 2021 alle ore 16:51 Farley, Peter x23353 <
> [email protected]> ha scritto:
>
>> I have the following situation which causes me to get an "out of
>> sequence" error for a merge operation.
>>
>> Three input files, all RECFM=VB, all the same LRECL and BLKSIZE.  Files 2
>> and 3 are frequently (but NOT always) empty except for header and trailer
>> records.  I believe that the DATA records in all files are in the correct
>> merge key sequence within each file, but my merge key specification could
>> be in error.
>>
>> The SYSIN uses an OMIT to remove all header and trailer records from the
>> merge operation, so when files 2 and 3 are processed they often contribute
>> no actual data records to the merge process.
>>
>> I get Syncsort messages like this complaining about "out of sequence":
>>
>> WER055I  INSERT          0, DELETE          1
>> WER068A  OUT OF SEQ SORTIN02 , BLOCK 56,917
>>
>> If I could ask Syncsort to tell me exactly what two merge keys are "out
>> of sequence" I could pinpoint the record location of the condition and
>> repair any merge key error I may have.
>>
>> Is there a way to ask Syncsort to tell me the exact keys that it thinks
>> are out of sequence?
>>
>> If it matters, Syncsort version is reported as "SYNCSORT FOR Z/OS
>> 2.1.6.0N".
>>
>> Peter
>>
>> This message and any attachments are intended only for the use of the
>> addressee and may contain information that is privileged and confidential.
>> If the reader of the message is not the intended recipient or an authorized
>> representative of the intended recipient, you are hereby notified that any
>> dissemination of this communication is strictly prohibited. If you have
>> received this communication in error, please notify us immediately by
>> e-mail and delete the message and any attachments from your system.
>>
>> ----------------------------------------------------------------------
>> 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

Reply via email to