Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : When you specified V for RECFM parameter, LRECL value is largest record in the file plus 4 bytes. These four bytes contain the actual length of each variable length record in the file

Google
 
Web mainframegurukul.com

"Merge" two files in a special way

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
cmkatz
Member


Joined: 18 Nov 2008
Posts: 8

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Nov 18, 2008 12:18 am    Post subject: "Merge" two files in a special way Reply with quote

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:

..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:

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:

CFHGSTZ TEXT...
3BCDEFA TEXTC...
9IJGREE TEXTD...


Thank you!!
cmkatz
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Nov 18, 2008 2:09 am    Post subject: Reply with quote

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?
_________________
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
cmkatz
Member


Joined: 18 Nov 2008
Posts: 8

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Nov 18, 2008 2:20 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Nov 18, 2008 2:37 am    Post subject: Reply with quote

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:

//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)
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort


Last edited by Frank Yaeger on Wed Nov 19, 2008 1:47 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
cmkatz
Member


Joined: 18 Nov 2008
Posts: 8

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
1 salutes

PostPosted: Tue Nov 18, 2008 2:42 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
cmkatz
Member


Joined: 18 Nov 2008
Posts: 8

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Nov 19, 2008 12:31 am    Post subject: didn't work, but I found a work around Reply with quote

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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Nov 19, 2008 1:46 am    Post subject: Reply with quote

You just need to change:

Code:

  OUTFIL VTOF,BUILD=(58,1200)


to

Code:

  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/software/sort/mvs/peug/

I've updated my previous post to include FNAMES=OUT to avoid confusion.
_________________
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
cmkatz
Member


Joined: 18 Nov 2008
Posts: 8

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Nov 19, 2008 2:42 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Nov 19, 2008 4:19 am    Post subject: Reply with quote

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.
_________________
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
academyindia4
Guest





Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Jan 25, 2016 10:34 pm    Post subject: Topic deleted by Admin Reply with quote

<< Content deleted By Admin >>
Back to top
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-3605.html