MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

COBOL field manipulation

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
avid_lrner
Beginner


Joined: 15 Apr 2005
Posts: 21
Topics: 9

PostPosted: Thu May 19, 2005 3:20 am    Post subject: COBOL field manipulation Reply with quote

Hey all,

Have a query:

I have 2 fields of a COBOL program:

1) AAA0AA 2) 000

The first field is alphanumeric....The second is a counter value.

I need a combination of these two.

For example:

AAA0AA000
AAA0AA001
AAA0AA002

Please give me an idea as to how I can achieve this.

Thanks and regards,
avid_lrner.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu May 19, 2005 6:18 am    Post subject: Reply with quote

avid_lrner,

Try this

Code:


01 WS-COMBINE-FIELD.
   05 WS-ALPHA-FIELD       PIC X(06) VALUE 'AAA0AA'
   05 WS-NUM-FIELD         PIC 9(03) VALUE 0.


   DISPLAY WS-COMBINE-FIELD
   ADD +1 TO WS-NUM-FIELD


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
avid_lrner
Beginner


Joined: 15 Apr 2005
Posts: 21
Topics: 9

PostPosted: Thu May 19, 2005 6:41 am    Post subject: COBOL field manipulation Reply with quote

It worked!

Thanks mate!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group