View previous topic :: View next topic |
Author |
Message |
avid_lrner Beginner
Joined: 15 Apr 2005 Posts: 21 Topics: 9
|
Posted: Thu May 19, 2005 3:20 am Post subject: COBOL field manipulation |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu May 19, 2005 6:18 am Post subject: |
|
|
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 |
|
|
avid_lrner Beginner
Joined: 15 Apr 2005 Posts: 21 Topics: 9
|
Posted: Thu May 19, 2005 6:41 am Post subject: COBOL field manipulation |
|
|
It worked!
Thanks mate! |
|
Back to top |
|
|
|
|