Sort Join to overlay a field in file 1 from file 2



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Sort Join to overlay a field in file 1 from file 2

Postby Oreod123 » Sat Jun 29, 2019 1:49 am

I am using the following sort/join
the input file 1 is a sequential file with an LRECL=500 and FB. Key in file 1 starts in position 17 for a length of 10
the input file 2 is LRECL=120 and is FB the key in file 2 starts in position 1 for a length of 10

I want to overlay position 434 in File 1(currently initialized and empty) with the field from File 2 which is in position 113 for 1 byte that is either an 'I' or an 'R'

I have tried to search these forums for help and found the following JCL.. when I try it, my field in file 1 is not populating from file 2.

Any help would be greatly appreciated!

//STEP01   EXEC PGM=SORT
//*
//SYSOUT   DD  SYSOUT=*
//SYSPRINT DD  SYSOUT=*
//SYSSNAP  DD  SYSOUT=*
//SYSDUMP  DD  SYSOUT=*
//*
//SORTJNF1 DD  DSN=file1,
//             DISP=SHR
//SORTJNF2 DD  DSN=file 2,
//             DISP=SHR
//SORTOUT  DD  DSN=abc.output.file,
//             DISP=(NEW,CATLG,DELETE),
//             SPACE=(CYL,(100,50),RLSE),
//             DCB=(LRECL=500,BLKSIZE=0,RECFM=FB)
//SORTWK01 DD  UNIT=(DASD,7),SPACE=(CYL,(1,50),RLSE)
//SORTWK02 DD  UNIT=(DASD,7),SPACE=(CYL,(1,50),RLSE)
//SORTWK03 DD  UNIT=(DASD,7),SPACE=(CYL,(1,50),RLSE)
//SORTWK04 DD  UNIT=(DASD,7),SPACE=(CYL,(1,50),RLSE)
//SORTWK05 DD  UNIT=(DASD,7),SPACE=(CYL,(1,50),RLSE)
//SORTWK06 DD  UNIT=(DASD,7),SPACE=(CYL,(1,50),RLSE)
//*
//SYSIN    DD  *
 JOINKEYS FILE=F1,FIELDS=(17,10,A)
 JOINKEYS FILE=F2,FIELDS=(1,10,A)
 JOIN UNPAIRED,F1
 REFORMAT FIELDS=(F1:1,500,?,F2:113,1)
 OPTION COPY

 OUTFIL IFOUTLEN=500,
  IFTHEN=(WHEN=(501,1,CH,EQ,C'B'),OVERLAY=(434:502,1))
Oreod123
 
Posts: 4
Joined: Sat Jun 29, 2019 1:35 am
Has thanked: 1 time
Been thanked: 0 time

Re: Sort Join to overlay a field in file 1 from file 2

Postby NicC » Sat Jun 29, 2019 3:26 pm

First of all this is not a JCL problem but a sort problem so post in the appropriate sort forum. Topic moved.
Now, which sort product are you using? DFsort, Syncsort or some other product?

Have you actually tried reading about JOINKEYS in your sort documentation? If not, why not?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Sort Join to overlay a field in file 1 from file 2

Postby Oreod123 » Mon Jul 01, 2019 7:11 pm

My appologies on posting in the incorrect forum... I have read documentation and I had found a solution on this forum...I was merely asking a question since I was pretty close to a solution... sorry to cause any confusion my problem is solved!


Thanks
Oreod123
 
Posts: 4
Joined: Sat Jun 29, 2019 1:35 am
Has thanked: 1 time
Been thanked: 0 time

Re: Sort Join to overlay a field in file 1 from file 2

Postby NicC » Mon Jul 01, 2019 9:44 pm

Excellent! Now...if you could post your solution...
It is always good to see the solution as it adds to the collection of solutions that enables others to solve their own problems.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Sort Join to overlay a field in file 1 from file 2

Postby Oreod123 » Mon Jul 01, 2019 9:57 pm

Yes.. When I posted this last week, I had copied my SORTJNF2 file to a FB file. Unfortunately I did not have this file in my JCL. Once I poined to the FB file, the results worked as expected.

Thank you to users Skolusu (member1359.html) and BGronli (member16573.html) which is where I found a solution they provided in another post!
Oreod123
 
Posts: 4
Joined: Sat Jun 29, 2019 1:35 am
Has thanked: 1 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post