View previous topic :: View next topic
|
Author |
Message |
sabarikanth
New User
Joined: 07 Jun 2010 Posts: 59 Location: coimbatore
|
|
|
|
Hi team,,
I need to know how to append an alphanumeric value with a numeric value.
Both the files have lrec of 80.
I used outrec buid option but i'm not able to get the exact o/p.
For example:
Input:
123
523
Output
A123
A523
I should use only SYNCSORT.. Please help..
thanks,
Sab |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Why not show us what you tried and what the output was. |
|
Back to top |
|
|
sabarikanth
New User
Joined: 07 Jun 2010 Posts: 59 Location: coimbatore
|
|
|
|
Quote: |
SORT FIELDS=COPY
OUTREC BUILD=(1,1,C'A',2,77) |
but i'm getting like
0A123
0A523 |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Don't you mean
OUTREC BUILD=(1:C'A',2,77)
isn't the 'A' supposed to be in column one? |
|
Back to top |
|
|
sabarikanth
New User
Joined: 07 Jun 2010 Posts: 59 Location: coimbatore
|
|
|
|
Ya.. It works. thanks a lot superk..
Please explain the syntax format...
Thanks,
Sab |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
sabarikanth wrote: |
Ya.. It works. thanks a lot superk..
Please explain the syntax format... |
Are you unable to read the manual for yourself ? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Spot the difference:
Code: |
OUTREC BUILD=(1,1,C'A',2,77) |
Code: |
OUTREC BUILD=(1:C'A',2,77) |
|
|
Back to top |
|
|
sabarikanth
New User
Joined: 07 Jun 2010 Posts: 59 Location: coimbatore
|
|
|
|
Hi,
I worked with the code
Code: |
OUTREC BUILD=(1:C'A',2,77) |
but i could see the value 'A' is not added in the first position in turn it got replaced with the first character.
I need the output as
I/p
123
O/p
A0123 Not as A123
Please let me know the correct format to add a value in the first position,. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Use...
Code: |
OUTREC BUILD=(1:C'A',1,79)
|
Note: 80th character from input will be truncated here as you want your output has LRECL 80 |
|
Back to top |
|
|
sabarikanth
New User
Joined: 07 Jun 2010 Posts: 59 Location: coimbatore
|
|
|
|
great...!!! Thanks.. |
|
Back to top |
|
|
|