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
 

 

String convertion

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
mihir.kumar

New User


Joined: 26 Jun 2008
Posts: 4
Location: Bangalore

PostPosted: Tue Oct 27, 2009 11:22 am    Post subject: String convertion
Reply with quote

Hi,

I have a variable ITEM-SIZE with picture clause X(7). It contains different type of data.

Eg:

20CT
200 OZ
20 CT
20 CT

I have to extract numeric part of it.

There are only one option that coming to my mind is to do numeric check bit by bit and to store the first position & length for numeric data. Then I will use reference modification to extract the numeric data.

Is there any other option?

Thanks in advance,
Mihir
Back to top
View user's profile Send private message

ajeshrn

New User


Joined: 25 Mar 2009
Posts: 78
Location: India

PostPosted: Tue Oct 27, 2009 11:27 am    Post subject:
Reply with quote

Hi mihir.kumar,

In that X(07), are do we have any assumption that the first 2 or 3 charecters will be Integers or Will these integers be followed by a single space?
Back to top
View user's profile Send private message
mihir.kumar

New User


Joined: 26 Jun 2008
Posts: 4
Location: Bangalore

PostPosted: Tue Oct 27, 2009 11:31 am    Post subject:
Reply with quote

Hi Ajesh,

File is updated from CICS screen and user can enter in any order. The data I have seen is of different type. Some have one space in between, some have two space in between, some is not having any space in between.



Thanks,
Mihir
Back to top
View user's profile Send private message
Steve Davies

New User


Joined: 15 Oct 2009
Posts: 32
Location: UK

PostPosted: Tue Oct 27, 2009 11:37 am    Post subject:
Reply with quote

if the input looks like this, '20CT559', I assume the output should look like '20559', and is the output field to be a numeric field or still a PIC X(7)?
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Tue Oct 27, 2009 11:52 am    Post subject:
Reply with quote

Mihir,
Quote:
user can enter in any order

If there is no specific data pattern, its better to check each byte.
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
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm
No new posts Which function does the Ampersand (&a... Andi1982 PL/I & Assembler 3 Wed Aug 24, 2016 2:05 pm
No new posts Need a help how to replace a string i... gurunath82 CLIST & REXX 12 Tue Jul 26, 2016 11:43 pm


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