Page 1 of 1

DFSort Merge clarification

PostPosted: Fri Oct 05, 2012 6:16 pm
by gowthamgyaa
Hi everyone,
The below merge conditions using JCL statements shows me an error, I tried it but am unable to solve with that, I need your experience hands in solving this,


//JOB STATEMNT
//STEP1 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SORTIN1 DD DSN=******.FINANCE.EMP,DISP=SHR
//SORTOUT DD DSN=*****.BACKUP.EMP,DISP=MOD
//SYSIN DD *
MERGE FIELDS=(5,2,CH,D)
/*
//


RECORDS IN FINANCE.EMP
001 cse 1005
002 ece 1111
008 mec 1007
014 cse 1222
077 aaa 1453
088 sss 1000
015 mmm 1005

RECORDS IN BACKUP.EMP
001 cse 1005
002 ece 1111
008 mec 1007
077 aaa 1453
015 mmm 1005
024 UTV 1017
028 MTV 1027
044 ATV 1113
012 ZZZ 1234

Kindly guide me what may be wrong in this.


Kind regards
gyaa

Re: DFSort Merge clarification

PostPosted: Fri Oct 05, 2012 6:50 pm
by enrico-sorichetti
The below merge conditions using JCL statements shows me an error,


Kindly guide me what may be wrong in this.


instead of having everybody guessing why don' You start by telling us what error You received ...

most probably if You look at Your input You will find out that it is not in sequence as required by a MERGE application

Re: DFSort Merge clarification

PostPosted: Fri Oct 05, 2012 6:56 pm
by gowthamgyaa
@enrico,
Thank you very much for the quick guidance.


Kind regard's
gyaa

Re: DFSort Merge clarification

PostPosted: Fri Oct 05, 2012 6:57 pm
by BillyBoyo
With the sample you show, Enrico has your answer. For MERGE, the data has to be in sequence on the key. If data is not in sequence, you SORT.

Re: DFSort Merge clarification

PostPosted: Fri Oct 05, 2012 7:08 pm
by NicC
you also have 2 sortout ddnames - you can only have one. (You can have more than one but all but one will be ignored - I will leave it to you to research which one will be used). An why do you have DISP=MOD on your SORTOUT? Do you really want to add data to what is already in that dataset?

The sort manual has a whole chapter devoted to the JCL requirements that you need - read it, along with the JCL manual.

Re: DFSort Merge clarification

PostPosted: Fri Oct 05, 2012 8:49 pm
by skolusu
gowthamgyaa,

You need to show us the error message you got or you can look it up your self which is pretty much self explanatory. Here is the manual for checking the error messages

http://publibz.boulder.ibm.com/cgi-bin/ ... /CCONTENTS