Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

remove leading zeros from array element

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: remove leading zeros from array element
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    Post subject: Re: remove leading zeros from array element
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 pm
No new posts Sort Card to Remove Duplicate records... raj4neo SYNCSORT 2 Wed Jan 25, 2017 4:44 am
No new posts Dynamic array request/response contai... Suja.Sai CICS 2 Tue Jan 24, 2017 11:37 am
No new posts Remove Special Characters from Mainfr... Rodger Zhang All Other Mainframe Topics 6 Wed Jul 06, 2016 1:12 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us