MERGE problem using VB input file



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

MERGE problem using VB input file

Postby pmerc8888 » Thu Aug 14, 2008 4:33 pm

Hi,

I'm trying to learn to use the MERGE application of SYNCSORT as I need to give a presentation about it. I usually just use SORT and COPY. Can someone tell me why one would prefer to use MERGE instead of SORT or COPY?

Additionally, I tried to run a similar JCL below but encountered a WER068A OUT OF SEQ SORTIN02 , BLOCK 1 error. I looked it up from the manual and found the following explanation: "A record in the SORTIN data set indicated by xx is out of sequence according to the FIELDS specification on the MERGE statement.". I checked the contents of my SORTIN02 but couldn't work out which record could be out of sequence and/or why. Can someone help, please.

Kindly note that all my input files are VB.

sample JCL:
==========
//JS010    EXEC PGM=SORT                         
//SYSOUT    DD SYSOUT=*                         
//SORTOUT   DD DSN=PMERCOUT,     
//             DISP=(NEW,CATLG,DELETE),         
//             UNIT=SYSDA,                       
//             SPACE=(CYL,(20,20),RLSE),         
//             DCB=(RECFM=VB,LRECL=374,BLKSIZE=0)
//*                                             
//SORTIN01  DD DISP=SHR,DSN=PMERCIN1
//SORTIN02  DD DISP=SHR,DSN=PMERCIN2
//SORTIN03  DD DISP=SHR,DSN=PMERCIN3
//SYSIN    DD *                                 
 MERGE FIELDS=(5,6,CH,A)                         
/*                                               


first 8 characters of the two records of SORTIN02:
==========================================
SPR000\.!
SPRABC\RU
pmerc8888
 
Posts: 16
Joined: Thu Aug 14, 2008 4:06 pm
Location: China
Has thanked: 0 time
Been thanked: 0 time

Re: MERGE problem using VB input file

 

Re: MERGE problem using VB input file

Postby MrSpock » Thu Aug 14, 2008 5:04 pm

pmerc8888 wrote:Can someone tell me why one would prefer to use MERGE instead of SORT or COPY?


MERGE is used to combine multiple sorted files into a single file. The MERGE process presumes that the specified input files are already in sorted order by the key field. Obviously, a MERGE should take much less time to process than a SORT since no SORT operation has to take place. A COPY can only copy the files in the same order in which they were originally written.
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: MERGE problem using VB input file

Postby pmerc8888 » Thu Aug 14, 2008 5:41 pm

Thanks MrSpock. I hope you don't mind the following additional questions:

1. Although the MERGE process assumes that the specified input files are already in sorted order, it would still sort/arrange the records in the order I specify in the FIELDS part of the statement, is that correct?

2. Would I be correct in thinking that if I were to combine 16 files or less, it would be better to more efficient to have MERGE FIELDS=COPY than SORT FIELDS=COPY?

Thanks again :)
pmerc8888
 
Posts: 16
Joined: Thu Aug 14, 2008 4:06 pm
Location: China
Has thanked: 0 time
Been thanked: 0 time

Re: MERGE problem using VB input file

Postby Bill Dennis » Thu Aug 14, 2008 7:41 pm

pmerc,

1. The MERGE FIELDS define what "key" the separate files are in sequence by. The merge file records will also be in sequence on that key.

2. Apparently, MERGE FIELDS=COPY is a misnomer and actually performs a SORT FIELDS=COPY. Thus only the SORTIN file is copied to SORTOUT.
Regards,

Bill Dennis

Disclaimer: My comments on this forum are my own and do not represent the opinions or suggestions of any other person or business entity.
Bill Dennis
 
Posts: 278
Joined: Thu May 15, 2008 9:45 pm
Has thanked: 0 time
Been thanked: 0 time

Re: MERGE problem using VB input file

Postby Bill Dennis » Thu Aug 14, 2008 7:47 pm

pmerc,

Also, your sample records for file SORTIN02 are out of sequence. Zero (SPR0) falls after A (SPRA) in the normal sort sequence.
Regards,

Bill Dennis

Disclaimer: My comments on this forum are my own and do not represent the opinions or suggestions of any other person or business entity.
Bill Dennis
 
Posts: 278
Joined: Thu May 15, 2008 9:45 pm
Has thanked: 0 time
Been thanked: 0 time

Re: MERGE problem using VB input file

Postby dick scherrer » Fri Aug 15, 2008 12:53 am

Hello,

It may be worth mentioning that the "collating sequence" of the mainframe is ebcdic while the collating sequence of UNIX and Windows is ascii.

The first difference most people discover is that on the mainframe letters sort before numerals while on the UNIX and Windows platforms the reverse is true.

Another is that on the mainframe there are values between I (eye) and J (jay), and R and S, while in ascii the alphabet is contiguous.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: MERGE problem using VB input file

Postby pmerc8888 » Sun Aug 17, 2008 7:55 am

Greetings Bill and Dick,

Thank you kindly for both your replies.

Once Dick pointed out that the MERGE FIELDS define what "key" the separate files are in sequence by, I realise that SYNCSORT actually REQUIRES the records in the input files to be in sorted order and it would issue that "out of sequence" error if that is not the case. And so I organized the input files and it worked beautifully :)

Thanks, too, for reminding me that there are values between I and J (jay), and R and S :)

Both your inputs help.

Thanks again :)
pmerc8888
 
Posts: 16
Joined: Thu Aug 14, 2008 4:06 pm
Location: China
Has thanked: 0 time
Been thanked: 0 time

Re: MERGE problem using VB input file

Postby dick scherrer » Sun Aug 17, 2008 7:59 am

You're welcome - good luck with the presentation :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post