Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Combine two files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Fri Sep 26, 2008 4:49 pm    Post subject: Combine two files
Reply with quote

Hi all,

Please help me with this issue. I Having two files both are having same recl = 80.

I need to prepare a output file if 1 to 26 position of both the input files record are same then copy the 55th to 58th positions content of INP2 to 27th to 30th position of INP1. and the rest bit will be the content of INP1.

for e.g:-
INP1
Code:

----+----1----+----2----+----3--
0303736;200701038870;PC03;MARVIN
0303736;200701038870;PC03;MARVIN



INP2
Code:

----+----1----+----2----+----3--
0303736;200701038870;abcd;jealon
0303736;200701038870;cdef;dasjdhja



INP2
Code:

----+----1----+----2----+----3--
0303736;200701038870;abcd;MARVIN
0303736;200701038870;cdef;MARVIN


Please guys i need this till today end. I was trying this since morning and unable to do that. So please help me .


Thanks.[/code]
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Sep 26, 2008 4:54 pm    Post subject:
Reply with quote

If you post your code then someone might find it easier to help you.
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Fri Sep 26, 2008 4:58 pm    Post subject:
Reply with quote

Hi,
I m trying to use the code as follows.
Code:

//TOOLIN   DD *                             
      COPY   FROM(IN1)   TO(T1)             
      COPY   FROM(IN2)   TO(T1)  USING(CTL1)
   SPLICE FROM(T1)   TO(OUT) ON(1,26,CH)   -
              ON(31,80,CH)  WITH(27,4)   
/*                                           
//CTL1CNTL DD *                             
             
   INREC BUILD=(27:27,4)                 


please tell me how to proceed.
Back to top
View user's profile Send private message
hchinnam

New User


Joined: 18 Oct 2006
Posts: 73

PostPosted: Fri Sep 26, 2008 5:46 pm    Post subject: Reply to: Combine two files
Reply with quote

Niki,

Your question doesn't match with your data. Your question doesn't match with your code either.

For starters try this code and let me know

Code:



//TOOLIN   DD *                             
      COPY   FROM(IN1)   TO(T1)             
      COPY   FROM(IN2)   TO(T1)
   SPLICE FROM(T1)   TO(OUT) ON(1,26,CH)   -
               WITH(55,4)   
/*                                           
Back to top
View user's profile Send private message
hchinnam

New User


Joined: 18 Oct 2006
Posts: 73

PostPosted: Fri Sep 26, 2008 5:54 pm    Post subject: Re: Combine two files
Reply with quote

Niki wrote:


then copy the 55th to 58th positions content of INP2 to 27th to 30th position of INP1.



sorry overlooked this part. Try the one below

Code:



//TOOLIN   DD *                             
      COPY   FROM(IN1)   TO(T1)             
      COPY   FROM(IN2)   TO(T1)  USING(CTL1)
   SPLICE FROM(T1)   TO(OUT) ON(1,26,CH)   -
              WITH(27,4)   
/*                                           
//CTL1CNTL DD *                             
             
   INREC OVERLAY=(27:55,4)   

Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Sep 26, 2008 5:55 pm    Post subject:
Reply with quote

Niki you are doing on(1,26,CH) and all four records are same so it will so only one record in output...
what is the data at 31 (length 80) ? is it missing in sample input you have given?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Sep 26, 2008 7:46 pm    Post subject:
Reply with quote

Quote:
Please guys i need this till today end


Then you should have taken the time to post correct input and output examples. What you've posted as the examples is impossible to make any sense of. You show one INP1 file and two INP2 files, but no expected output file. Is the second INP2 supposed to be the output file?

You only show records that don't match and you don't show positions 55-58 for INP2 even though you mentioned them.

Take the time to post a proper example of the records in each input file and what you expect for output, with all variations. If either input file can have duplicates within it, show that in your example.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts Adding records from two files into on... shiitiizz SYNCSORT 4 Mon Sep 19, 2016 8:41 pm
No new posts Icetool or Joinkeys example to compar... ishant chauhan DFSORT/ICETOOL 21 Sat Aug 20, 2016 2:40 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us