Page 1 of 1

"Merge" two files in a special way

Posted: Tue Nov 18, 2008 12:18 am
by cmkatz
Hi there,

I hope you can help me!

I have two input-files with following records:

File A (LRECL=8000, variable length, first two bytes have the information of the recordlength, Sortkey on Byte 58, Length = 6 Bytes):

Code: Select all

..text1...... ABC6DEF BLABLA...
..text3...... CFHGSTZ TEXT...
..text4...... I4GHD5G TEXTB...
..text5...... 3BCDEFA TEXTC...
..text6...... 9IJGREE TEXTD...
File B (LRECL=6, Sortkey as in File A):

Code: Select all

CFHGSTZ
3BCDEFA
9IJGREE

Now I want to write the record of file A into a new outputfile C (LRECL=1200), if the key in file B matches a key in file A, so that file C looks like this:

Code: Select all

CFHGSTZ TEXT...
3BCDEFA TEXTC...
9IJGREE TEXTD...
Thank you!!
cmkatz

Posted: Tue Nov 18, 2008 2:09 am
by Frank Yaeger
What is the RECFM of FileA? What is the RECFM of FileB? What is the RECFM of FileC?

Can FileA have duplicate keys within it?

Can FileB have duplicate keys within it?

Posted: Tue Nov 18, 2008 2:20 am
by cmkatz
Sorry, I forgot to mention:

File A: RECFM=VB
File B: RECFM=FB
File C: RECFM=FB

No, none of the files have duplicate keys, and the keys are in ascending order

Thank you for your answer!
cmkatz

Posted: Tue Nov 18, 2008 2:37 am
by Frank Yaeger
Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed when you said the Sortkey starts on byte 58, you were counting the RDW in positions 1-4 (so the first data byte starts in position 5). If not, then use 62,1200 instead of 58,1200.

Code: Select all

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1 (VB/8000)
//IN2 DD DSN=...  input file2 (FB/6)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/1200)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(1,6,CH) FIRSTDUP
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=OUT,VTOF,BUILD=(58,1200)
/*
//CTL2CNTL DD *
  INREC OVERLAY=(1200:X)
/*

Posted: Tue Nov 18, 2008 2:42 am
by cmkatz
Thank you very much!!

I'll try tomorrow (I'm from Germany, now it's 10:43 pm local time) and give a feedback asap.

cmkatz

didn't work, but I found a work around

Posted: Wed Nov 19, 2008 12:31 am
by cmkatz
So, here's my feedback...

it didn't work, I always got an error messages saying that cntlout is missing or can not be allocated (I can't recall the correct message).

I searched the internet and found some information, that the reason for this message may possibly be a missing T1 dataset, so I defined a dataset, but that also didn't work.

But I found a "work around" using DFSORT. It had some more steps but i worked.

I can post the JCLs I've tried an the error message tomorrow. Maybe you or some other users can give hints or tell me what mistakes I've made.

Never the less: Thank you!!! =D

cmkatz

Posted: Wed Nov 19, 2008 1:46 am
by Frank Yaeger
You just need to change:

Code: Select all

  OUTFIL VTOF,BUILD=(58,1200) 
to

Code: Select all

  OUTFIL FNAMES=OUT,VTOF,BUILD=(58,1200) 
You don't need FNAMES=OUT with the latest DFSORT PTF (July, 2008) which I'm running with. You do need it if you don't have the latest DFSORT PTF, which you apparently don't.

Ask your System Programmer to install z/OS DFSORT V1R5 PTF UK90013 (July, 2008). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTFs, see:

www.ibm.com/servers/storage/support/sof ... /mvs/peug/

I've updated my previous post to include FNAMES=OUT to avoid confusion.

Posted: Wed Nov 19, 2008 2:42 am
by cmkatz
ok, I'll give it a try, thank you.

But:
It could be difficult to ask our System Operator to update our system, because we're a big and worldwide company. It's a loooong way (and needs many instances to say "yes") for a "simple developers" to get suggestions realized.

(I hope you can understand what I'm trying to say, because it has been a long time ago since I spoke and written English!)

Greets
cmkatz

Posted: Wed Nov 19, 2008 4:19 am
by Frank Yaeger
Yes, I understand the problem with getting things changed in a worldwide company (your English is much better than a lot of what we see here).

For this particular job you can just add FNAMES=OUT. Unfortunately, if you want to use other new DFSORT functions that are only available with the July, 2008 PTF like FINDREP, WHEN=GROUP, DATASORT, SUBSET, etc, you'll be out of luck if you can't get the PTF installed.

Topic deleted by Admin

Posted: Mon Jan 25, 2016 10:34 pm
by academyindia4
<< Content deleted By Admin >>