Page 3 of 3

Re: COmparing files using syncsort and Cobol

PostPosted: Fri Mar 22, 2013 11:43 pm
by tony1131
I am sorting a file using syncsort, then using that output file within my cobol program to do a compare, The file that I am sending out can't contain the dash. And I don't know if this is done in the syncsort or where I am writing my cobol program. So i couldn't answer the guy. I registered this account saying I'm a beginner, and also mentioned it in the thread many times. I didn't even know what JCL was a month ago. So it might seem to you someone that has experience in the field that I am not using my brain, but I am explaining my situation the best I can. Have some patience

Re: COmparing files using syncsort and Cobol

PostPosted: Fri Mar 22, 2013 11:46 pm
by dick scherrer
Hello,

but don't know if it's syncsort or cobol that would get rid of the dash in my output
That would be up to you . . .

I suspect you will be ahead if you pursue the COBOL solution. If someone provided a sorting solution, it is most likely that you would not understand it at this time. Being new, you most likely have done only "simple" sorting.

If you use a COBOL solution, the COBOL code would remove the dash (before the compare).

Re: COmparing files using syncsort and Cobol

PostPosted: Sat Mar 23, 2013 1:30 am
by BillyBoyo
Since the task is for Cobol practice, do everything in Cobol except for a simple "sort" of each of your input files before the matching.

Here is one way to "get rid" of your "-" in Cobol.

01  a-field.
    05  af-first-part pic xx.
    05  af-dash pic x.
    05  af-last-part pic x(4).

01 another-field.
    05  anf-first-part pic xx.
    05  anf-last-part pic x(4).

    MOVE af-first-part TO anf-first-part
    MOVE af-last-part TO anf-last-part


There is no problem in sorting with the "-" in the field, as it is always present and always in the same place, so it will not affect the sort order into your program even if it not with the "-" on both files.

Re: COmparing files using syncsort and Cobol

PostPosted: Sat Mar 23, 2013 4:49 pm
by NicC
And NO, JCL cannot remove the dashes in your data as JCL does not look at any data. It does as was specified earlier.