Page 1 of 1

Problem using syncsort

PostPosted: Tue Jul 07, 2015 7:29 am
by aripallig
In my jcl I have sortin & sort out as same one dataset and they are FB of length 80, when I try writing adding characters to file, characters are written correctly but the rest of the files is also been filled with ‘00’ instead of ‘0E’ As shown below
File Contents:-
Input : XXXXXXXXXXXX
Expected output is : XXXXXXXXXXXX123A
After I apply below sort card : XXXXXXXXXXXX123A……..

JCL :-
//SORTIN DD DSN=DATASET,DISP=SHR
//SORTOUT DD DSN=DATASET,DISP=SHR
//SYSIN DD*
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,12,
13:C’123A’)

Please suggest what changes I need to do in my sort card to fix this.

Thanks,
Giri

Re: Problem using syncsort

PostPosted: Tue Jul 07, 2015 11:05 am
by enrico-sorichetti
while You might get away using the same dataset for input and output in a SORT application
( the dataset is read into the work files and rewritten from the work files )
doing the same for a COPY application is a NONO

Re: Problem using syncsort

PostPosted: Tue Jul 07, 2015 12:30 pm
by BillyBoyo
What do you think X'0E' is and why do you think you should see one?

As enrico has said, to use the same dataset for input and output to a COPY operation is flat-out idiotic. The same dataset name for input and output for a SORT is possible, it is termed a "Suicide SORT" by DFSORT Developers, so that may give you a clue as to whether even that is a good idea.

Change the DSNs. Don't use OUTREC for this. Never use OUTREC FIELDS (except where it already exists in code) use OUTREC BUILD. Don't use BUILD for this.

For this example:
  OPTION COPY
  INREC OVERLAY=(13:C'123A')