View previous topic :: View next topic
|
Author |
Message |
Niki
Active User
Joined: 20 Sep 2008 Posts: 106 Location: Bangalore
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
If you post your code then someone might find it easier to help you. |
|
Back to top |
|
|
Niki
Active User
Joined: 20 Sep 2008 Posts: 106 Location: Bangalore
|
|
|
|
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 |
|
|
hchinnam
New User
Joined: 18 Oct 2006 Posts: 73
|
|
|
|
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 |
|
|
hchinnam
New User
Joined: 18 Oct 2006 Posts: 73
|
|
|
|
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 |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|