Results 1 to 2 of 2

Thread: Input file obtained by merging 2 files

  1. #1
    Geek_Guest
    Guest

    Input file obtained by merging 2 files

    I have input file which is obtained by merging 2 files. (EACH HAVING SAY 3 REC)
    The 1st four columns are as below

    0001
    0002
    0003
    0001
    0002
    0003

    But i want the merged file to have
    0001
    0002
    0003
    0004
    0005

    In case we do not know the number of rec in both the input files...what can be done

    Question asked by visitor prabhu


  2. #2
    Junior Member
    Join Date
    Dec 2007
    Answers
    1

    Re: Input file obtained by merging 2 files

    You can obtain this by XSUM

    Syntax for XSUM - SUM FIELDS=NONE,XSUM in the Sort card, and a DDNAME SORTXSUM to define the file for XSUM.

    XSUM should be used when you have a case where the records from input file A should be copied to file B without duplicate records, and the eliminated duplicate records should be saved in a file C. Here file C will be the file for the DD name SORTXSUM.

    Example:

    JCL:
    Code:

    //STEP010 EXEC PGM=SORT
    //SYSOUT DD SYSOUT=*
    //SYSPRINT DD SYSOUT=*
    //SORTIN DD DSN=TEST.XSUM.INPUT,DISP=SHR
    //SORTOUT DD DSN=TEST.XSUM.OUTPUT,DISP=SHR
    //SORTXSUM DD DSN=TEST.XSUM.OUTPUT.XSUM,DISP=SHR
    //SYSIN DD *
    SORT FIELDS=(2,10,CH,A)
    SUM FIELDS=NONE,XSUM



    Input file:

    Code:

    0001
    0002
    0003
    0001
    0002
    0003



    Output: Output without duplicate:
    Code:

    0001
    0002
    0003
    0004
    0005


    Output: Duplicate records alone (XSUM File)
    Code:
    0001
    0002
    0003


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact