Merging two files by column



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Merging two files by column

Postby ehofas » Thu Sep 27, 2012 6:34 pm

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.
ehofas
 
Posts: 6
Joined: Thu Sep 27, 2012 6:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Merging two files by column

 

Re: Merging two files by column

Postby BillyBoyo » Thu Sep 27, 2012 7:11 pm

Do you want to do it in Cobol? Or what?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Merging two files by column

Postby ehofas » Thu Sep 27, 2012 7:12 pm

No, JCL.
ehofas
 
Posts: 6
Joined: Thu Sep 27, 2012 6:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Merging two files by column

Postby NicC » Thu Sep 27, 2012 7:23 pm

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?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Merging two files by column

Postby NicC » Thu Sep 27, 2012 7:24 pm

BTW - welcome to the forum.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Merging two files by column

Postby Akatsukami » Thu Sep 27, 2012 7:25 pm

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.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Merging two files by column

Postby NicC » Thu Sep 27, 2012 7:34 pm

You probably want something along the lines of JOINKEYS in whichever sort product you use.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Merging two files by column

Postby BillyBoyo » Thu Sep 27, 2012 8:12 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Merging two files by column

Postby dick scherrer » Thu Sep 27, 2012 8:27 pm

Hello and welcome to the forum,

Do be aware that you Now Need to provide the requested info. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Merging two files by column

Postby ehofas » Fri Sep 28, 2012 2:31 am

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.
ehofas
 
Posts: 6
Joined: Thu Sep 27, 2012 6:20 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post