IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to append an alphanumeric value..?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sabarikanth

New User


Joined: 07 Jun 2010
Posts: 59
Location: coimbatore

PostPosted: Wed Apr 06, 2011 1:52 am
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Apr 06, 2011 2:00 am
Reply with quote

Why not show us what you tried and what the output was.
Back to top
View user's profile Send private message
sabarikanth

New User


Joined: 07 Jun 2010
Posts: 59
Location: coimbatore

PostPosted: Wed Apr 06, 2011 2:04 am
Reply with quote

Quote:
SORT FIELDS=COPY
OUTREC BUILD=(1,1,C'A',2,77)


but i'm getting like

0A123
0A523
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Apr 06, 2011 2:11 am
Reply with quote

Don't you mean

OUTREC BUILD=(1:C'A',2,77)

isn't the 'A' supposed to be in column one?
Back to top
View user's profile Send private message
sabarikanth

New User


Joined: 07 Jun 2010
Posts: 59
Location: coimbatore

PostPosted: Wed Apr 06, 2011 2:15 am
Reply with quote

Ya.. It works. thanks a lot superk..

Please explain the syntax format...

Thanks,
Sab
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Apr 06, 2011 12:54 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Apr 08, 2011 7:33 pm
Reply with quote

Spot the difference:
Code:
OUTREC BUILD=(1,1,C'A',2,77)

Code:
OUTREC BUILD=(1:C'A',2,77)
Back to top
View user's profile Send private message
sabarikanth

New User


Joined: 07 Jun 2010
Posts: 59
Location: coimbatore

PostPosted: Mon Apr 11, 2011 7:28 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Apr 11, 2011 7:38 pm
Reply with quote

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
View user's profile Send private message
sabarikanth

New User


Joined: 07 Jun 2010
Posts: 59
Location: coimbatore

PostPosted: Mon Apr 11, 2011 7:51 pm
Reply with quote

great...!!! Thanks..
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Duplicate data in PUT CONTAINER using... CICS 4
No new posts I want to append a record in an exist... CLIST & REXX 17
No new posts convert alphanumeric PIC X(02) to hex... COBOL Programming 3
Search our Forums:

Back to Top