IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Combine two files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Niki

Active User


Joined: 20 Sep 2008
Posts: 106
Location: Bangalore

PostPosted: Fri Sep 26, 2008 4:49 pm
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: 8797
Location: Welsh Wales

PostPosted: Fri Sep 26, 2008 4:54 pm
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: 106
Location: Bangalore

PostPosted: Fri Sep 26, 2008 4:58 pm
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
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
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
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 Developer


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

PostPosted: Fri Sep 26, 2008 7:46 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top