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

String convertion


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts file manager is doing string conversion IBM Tools 3
No new posts Search string in job at regular Spool... CLIST & REXX 0
Search our Forums:

Back to Top