View previous topic :: View next topic
|
Author |
Message |
balajipradeep
New User
Joined: 12 Mar 2009 Posts: 21 Location: chennai
|
|
|
|
Hi,
In the Input file one column in the position 135 of length 9. Another column in the Position 170&length 4 bytes.
I need to get the 2 columns value in the Input file to the output file. But my Output file should be like this.(it should start at 13 position)
Output:
(COLM_TYPE_CDE='4byt' AND COLM_NBR='N00368967') OR
I need to do it in Sync Sort Outrec. Any one help me out. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hello Balaji,
Your Q is not clear please provide sample input and output |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Quote: |
to get the 2 columns value |
They are fields not columns.
Quote: |
.(it should start at 13 position) |
What do you mean by this?
Quote: |
Input file one column in the position 135 of length 9. Another column in the Position 170&length 4 bytes |
If you only want these fields to output use
Code: |
INREC BUILD=(135,9,170,4) |
This will produce 13 byte output file with these two fields...
Quote: |
(COLM_TYPE_CDE='4byt' AND COLM_NBR='N00368967') OR |
what do you want to tell this? |
|
Back to top |
|
|
balajipradeep
New User
Joined: 12 Mar 2009 Posts: 21 Location: chennai
|
|
|
|
Hi,
I want the Ouptu format same as below. With open bracket at 13 postion etc.
Input file:
Position 135 170
Field colm_type colm-type
Length 9 BYTE 4 BYTES
Output file:
(colm_TYPE_CDE='PDP ' AND colm_NBR='N00924841') OR
(colm_TYPE_CDE='PDP ' AND Colm_NBR='N00924842') OR
(colm_TYPE_CDE='PDP ' AND Colm_NBR='N00924843') OR
How o accomplish this same format output with open bracket at 13 postition and finishing with 'OR'. Please do it in sort. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Balaji,
Balaji wrote: |
Please do it in sort.
|
Then what YOU will do? |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hello Balaji,
Please try below sort card
Code: |
SORT FIELDS=COPY
OUTREC BUILD=(12X,C'(COLM_TYPE_CDE=',X'7D',170,4,X'7D',C' AND COLM_NBR=',
X'7D',135,9,X'7D',C') OR') |
|
|
Back to top |
|
|
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
Guptae is correct , alternativey i think u can replace X'7D' with C''' also .
Just on the lighter side , did you even try once before posting |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
You can Use...
Code: |
//SYSIN DD *
SORT FIELDS=COPY
INREC BUILD=(13:C'(COLM_TYPE_CDE=''',135,9,
C''' AND COLM_NBR=''',170,4,C''') OR')
/*
|
|
|
Back to top |
|
|
|