View previous topic :: View next topic
|
Author |
Message |
cheethra
New User
Joined: 20 Jan 2007 Posts: 6 Location: India
|
|
|
|
I have to copy a field in a particular position from two records in sortin file and write out both the fields as single record in sortout file. |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi cheethra.
Can you specify more details, so that it will be easy to analyze. |
|
Back to top |
|
|
cheethra
New User
Joined: 20 Jan 2007 Posts: 6 Location: India
|
|
|
|
eg:
Input file:
A1AAAAAAAAAAAAAAAAAA1998BBBBBBBBBBBBBBBBBBBBBB
A2AAAAAAAAAAAAAAAAAA2000BBBBBBBBBBBBBBBBBBBBBB
B1AAAAAAAAAAAAAAAAAA1994BBBBBBBBBBBBBBBBBBBBBB
B2AAAAAAAAAAAAAAAAAA2005BBBBBBBBBBBBBBBBBBBBBB
Output:
A 1998 2000
B 1994 2005
Condition: if A (A1 & A2 data are picked up and written as single record)
if B(B1 & B2 are written similarly) |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
cheethra,
Could you tell how your o/p should look for the following i/p -
Quote: |
A1AAAAAAAAAAAAAAAAAA1998BBBBBBBBBBBBBBBBBBBBBB
A2AAAAAAAAAAAAAAAAAA2000BBBBBBBBBBBBBBBBBBBBBB
A3AAAAAAAAAAAAAAAAAA2999BBBBBBBBBBBBBBBBBBBBBB
B1AAAAAAAAAAAAAAAAAA1994BBBBBBBBBBBBBBBBBBBBBB
B2AAAAAAAAAAAAAAAAAA2005BBBBBBBBBBBBBBBBBBBBBB
B3AAAAAAAAAAAAAAAAAA2777BBBBBBBBBBBBBBBBBBBBBB
B4AAAAAAAAAAAAAAAAAA2888BBBBBBBBBBBBBBBBBBBBB |
|
|
Back to top |
|
|
cheethra
New User
Joined: 20 Jan 2007 Posts: 6 Location: India
|
|
|
|
hey cmon dont change my requirement :-)
I wil have only A1 and A2 for A and B1 & B2 for B. its always two records.
I have only four records in my input file.
hope i am clear
thanks |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Cheetra,
Quote: |
dont change my requirement |
Im not. Just trying to understand your req clearly for better suggestion.
Quote: |
I wil have only A1 and A2 for A and B1 & B2 for B. its always two records. |
If this is the case, you can SPLICE the records. Search DFSORT forum for examples. Your key is going to be A and B. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
cheethra
Here is the DFSORT/ICETOOl JCL for your requirement
Code: |
//STEP001 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
A1AAAAAAAAAAAAAAAAAA1998BBBBBBBBBBBBBBBBBBBBBB
A2AAAAAAAAAAAAAAAAAA2000BBBBBBBBBBBBBBBBBBBBBB
B1AAAAAAAAAAAAAAAAAA1994BBBBBBBBBBBBBBBBBBBBBB
B2AAAAAAAAAAAAAAAAAA2005BBBBBBBBBBBBBBBBBBBBBB
C1AAAAAAAAAAAAAAAAAA1904BBBBBBBBBBBBBBBBBBBBBB
C2AAAAAAAAAAAAAAAAAA2007BBBBBBBBBBBBBBBBBBBBBB
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
SPLICE FROM(IN1) TO(OUT) ON(1,1,CH) WITH(9,4) -
USING(CP01)
/*
//CP01CNTL DD *
INREC IFOUTLEN=80,
IFTHEN=(WHEN=(2,1,ZD,EQ,1),BUILD=(1,1,4:21,4)),
IFTHEN=(WHEN=(2,1,ZD,EQ,2),BUILD=(1,1,9:21,4))
/*
|
|
|
Back to top |
|
|
|