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

remove leading zeros from array element


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dipanshu

New User


Joined: 16 Jan 2006
Posts: 53
Location: pune

PostPosted: Fri Jan 27, 2006 7:24 pm
Reply with quote

Sub field is a seven character field, the characters in position 1-2 are alpha and characters in positions 3-7 are numeric, e.g. ?ON01234?. we have to remove leading zeroes from the sub field so that ?ON01234? becomes ?ON1234?

Sub is an array element say subarc(x)

By using chracter handling verbs or through refrence modifier

Pls assist with example

Regards & thanks
Dipanshu
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Fri Jan 27, 2006 9:54 pm
Reply with quote

Dipanshu,

There are several ways to accomplish this, Here is one:

Code:

   05 SUBARC   PIC x(7).

   PERFORM
     UNTIL SUBARC(3:1) not = ?0?
       MOVE SUBARC(4:4)  to SUBARC(3:5)
   END-PERFORM



Others will probably also have ideas

Enjoy

Dave,
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Remove leading zeroes SYNCSORT 4
No new posts leading spaces can be removed in trai... DFSORT/ICETOOL 1
No new posts COBOL Ascending and descending sort n... COBOL Programming 5
Search our Forums:

Back to Top