Page 1 of 2

Merging two files by column

PostPosted: Thu Sep 27, 2012 6:34 pm
by ehofas
Hello everyone, I'm new to this forum and i don't really know how and where should I post this, so excuse me for incorrectly selected section and everything else.
My problem is, that I want to merge two files.
For example:
INFILE1:
Name LastName 00000001 Accepted 0001
Namee LastNamee 00000002 Accepted 0001

INFILE2:
Name 865482123 00000001
Namee 865482123 00000002

OUTFILE:
Name LastName 00000001 Accepted 865482120
Namee LastNamee 00000002 Accepted 865482121

so, in out file i want to have columns 0-40 from INFILE1, and columns 40-50 from INFILE2.

Re: Merging two files by column

PostPosted: Thu Sep 27, 2012 7:11 pm
by BillyBoyo
Do you want to do it in Cobol? Or what?

Re: Merging two files by column

PostPosted: Thu Sep 27, 2012 7:12 pm
by ehofas
No, JCL.

Re: Merging two files by column

PostPosted: Thu Sep 27, 2012 7:23 pm
by NicC
Cannot do it in JCL - JCL is not a programming language - it tells the mainframe what programs you want to run and what resources those programs need.

So, which language do you want to use or do you want to use a utility such as DFSORT or SYNCSORT?

Re: Merging two files by column

PostPosted: Thu Sep 27, 2012 7:24 pm
by NicC
BTW - welcome to the forum.

Re: Merging two files by column

PostPosted: Thu Sep 27, 2012 7:25 pm
by Akatsukami
ehofas wrote:No, JCL.

Well, you can't. You can do it with various utilities as, e.g., DFSORT, but those are not JCL, even if so miscalled by software engineers.

Now, think about what you want to do and how you want to do it and, if you finish before Moshiach ben Dovid comes (may we all see that day), get back to us.

Re: Merging two files by column

PostPosted: Thu Sep 27, 2012 7:34 pm
by NicC
You probably want something along the lines of JOINKEYS in whichever sort product you use.

Re: Merging two files by column

PostPosted: Thu Sep 27, 2012 8:12 pm
by BillyBoyo
If you tell us which sort product you use (ICE* messages in the sysout is DFSort, WER* messages in the sysout is SyncSort) then the topic can be moved to the appropriate forum here.

Re: Merging two files by column

PostPosted: Thu Sep 27, 2012 8:27 pm
by dick scherrer
Hello and welcome to the forum,

Do be aware that you Now Need to provide the requested info. . .

Re: Merging two files by column

PostPosted: Fri Sep 28, 2012 2:31 am
by ehofas
I didin't realise that SORT and DFSort utilities aren't JCL. I want to do this by using either of them, but I think the most suitable one for this would be ICETOOL. I'm not sure though how to complete ICETOOL statement, and what does the parameters sent in by SYSIN mean. I would love if someone could give an example of a JCL(or COBOL, I'm pretty lost here now) to complete this task.
Thanks for welcoming.