Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8619
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 Can we combine the rows with same key... V S Amarendra Reddy DB2 12 Fri Dec 01, 2017 10:29 pm
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm
No new posts Finding difference between two PS fil... Vignesh Sid SYNCSORT 5 Mon Oct 30, 2017 1:13 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us