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

How to check a underscore occurence in a field of 3 length.


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
krishna_ragav

New User


Joined: 29 Oct 2010
Posts: 10
Location: Chennai

PostPosted: Thu Mar 29, 2012 3:44 pm
Reply with quote

Hi all,

I have a field

Field1 W 03 A

There may be a case that Field1 contains

Field1 = '_XX' or
Field1 = 'XX_' or
Field1 = 'X_X' or
Field1 = '___' or
Field1 = 'X__' or
Field1 = '__X' or
Field1 = 'ABC'

X can be spaces. ABC is a valid value.

I have to check a condition where Field1 may consist of underscore in any of 3 position. That is i have to perform something in first 6 situations when Field1 contains underscore.

How to check it in easytrieve. Please help.

Thanks in advance.
Ashirwad
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Mar 29, 2012 4:15 pm
Reply with quote

What did you try yourself. It could be done by indexing or redefines.
Everything can be found in the manual. Or do you want me to write your code?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Mar 29, 2012 7:20 pm
Reply with quote

To add to Peter's advice, and you'll probably still have to look at the manual, so make sure you cover everything...

I would do this by defining an "instream table" with the possible values for your combinations of space and underscore.

To check for one of those values, you'd "search" the table. If present on the table, then you have your condition for processing the field with underscores.

Read the manual. Code it up. Run it. If you can't get it to work, post the code and the evidence of the problem. Explain how else you could do it from your reading of the manual...
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts To Unstring spaces in a field COBOL Programming 3
No new posts Help required to reset decimal points... DFSORT/ICETOOL 10
No new posts Sorting Date Field DFSORT/ICETOOL 4
No new posts Get RECORD LENGTH, allocated space of... CLIST & REXX 7
No new posts Using Multiple IFTHEN and WHEN condit... SYNCSORT 12
Search our Forums:


Back to Top