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

Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL
gadde9
Posts: 8
Joined: Thu Jul 19, 2018 8:54 pm
Skillset: IDMS, ADSo, JCL, Cobol & Assembly language
Referer: online forums

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

Postby gadde9 » Thu Dec 26, 2019 11:17 pm

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*

NicC
Global moderator
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
Referer: Google
Location: Pushing up the daisies (almost)

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

Postby NicC » Fri Dec 27, 2019 1:14 am

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

gadde9
Posts: 8
Joined: Thu Jul 19, 2018 8:54 pm
Skillset: IDMS, ADSo, JCL, Cobol & Assembly language
Referer: online forums

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

Postby gadde9 » Fri Dec 27, 2019 1:23 am

Thanks Nic, can you help me with a sample JCL for the above ?

NicC
Global moderator
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
Referer: Google
Location: Pushing up the daisies (almost)

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

Postby NicC » Fri Dec 27, 2019 3:25 pm

Sample JCL can be found in the DFSOrt manual chapter 2.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

User avatar
sergeyken
Posts: 458
Joined: Wed Jul 24, 2019 10:12 pm
Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
Referer: Internet search

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

Postby sergeyken » Fri Dec 27, 2019 6:10 pm

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.
Javas and Pythons come and go, but JCL and SORT stay forever.


  • Similar Topics
    Replies
    Views
    Last post