Page 1 of 1

Joinkeys on a file where position of the field is not fixed

PostPosted: Thu Dec 26, 2019 11:17 pm
by gadde9
Hi All,

Below is my scenario,

FIle 1:
H1,X1,Y1,Z1
H2,X2,Y2,Z2
H3,X3,Y3,Z3

File 2:

A1|B1|C1|X1|G1
A2||C2|X2|G2
A3|||X1|G1

I need to match X1 in both the files, in FIle 1 X1 is at a fixed position but in File 2 X1 is not at a fixed position, it always comes after three | symbols, is there a way to compare two fields mentioned using sort (Joinkeys) and if match found then replace H* with G*

Re: Joinkeys on a file where position of the field is not fi

PostPosted: Fri Dec 27, 2019 1:14 am
by NicC
Not a JCL question but a DFSort (or Syncsort) question. Topic moved.
To answer your question - can it be done using JOINKEYS - Yes it can. You will have to PARSE the second dataset first.

Re: Joinkeys on a file where position of the field is not fi

PostPosted: Fri Dec 27, 2019 1:23 am
by gadde9
Thanks Nic, can you help me with a sample JCL for the above ?

Re: Joinkeys on a file where position of the field is not fi

PostPosted: Fri Dec 27, 2019 3:25 pm
by NicC
Sample JCL can be found in the DFSOrt manual chapter 2.

Re: Joinkeys on a file where position of the field is not fi

PostPosted: Fri Dec 27, 2019 6:10 pm
by sergeyken
gadde9 wrote:Thanks Nic, can you help me with a sample JCL for the above ?

1) JCL has absolutely nothing to do with your question.

2) This is a HELP forum, not DO-MY-JOB-FOR-ME forum.