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

Select fixed number of characters - Easytrieve


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

New User


Joined: 27 Dec 2007
Posts: 73
Location: India

PostPosted: Fri Jan 23, 2009 10:38 am
Reply with quote

Hi All,

Is there any option available in Easytrieve to select fixed number of characters from a field. For eg, if I have the field defined like below..

FLD 1 80 A
WS-FLD W 20 A

Is there any option available wherein I could move only the last 20 charactes of FLD to WS-FLD..

Something like this in cobol, MOVE FLD(61:20) TO WS-FLD.. Something similar available in easytrieve..?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jan 23, 2009 11:09 am
Reply with quote

Hello,

You could define the last 20 bytes of fld as a different name (i.e. fld-last-20).

I am not aware of reference modification in Easytrieve.
Back to top
View user's profile Send private message
technut

New User


Joined: 27 Dec 2007
Posts: 73
Location: India

PostPosted: Fri Jan 23, 2009 11:23 am
Reply with quote

Yes.. that could be the only option then..

Dick - Do you know if we have an Unstring option in eztrieve..? I mean Unstring delimited by space, comma, special characters of that sort..

Thanks for your help as always!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jan 23, 2009 11:29 am
Reply with quote

Hello,

The way i've seen this done is treat the string as an array of 1-byte entries and manually unstring the data by looping. If this were my requirement, i might consider calling a cobol subprogram to do the unstring. . . This might be quicker to develop and would surely perform better if there was a high volume of data to be unstrung.
Back to top
View user's profile Send private message
technut

New User


Joined: 27 Dec 2007
Posts: 73
Location: India

PostPosted: Fri Jan 23, 2009 11:47 am
Reply with quote

That's a nice idea.... Yeah as you said cobol is much better in this case!
Thanks a lot..
Back to top
View user's profile Send private message
ameenansari

New User


Joined: 18 Sep 2006
Posts: 11
Location: chennai

PostPosted: Fri Jan 23, 2009 12:04 pm
Reply with quote

Technut,

Redifines concept in easytrieve will meet your requirement. Try the following

WS-FLD W 80 A
WS-FLD-FRST-60 FLD 60 A
WS-FLD-LAST-20 FLD +60 20 A

WS-FLD = FLD

DISPLAY WS-FLD-LAST-20
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jan 23, 2009 9:49 pm
Reply with quote

Hello,

Quote:
Redifines concept in easytrieve will meet your requirement.
Yes, that was the concept of the earlier suggestion.

Also, you might want to check the code posted - i believe it has a couple of typos. Once the typos are corrected, the code should also work without the WS-FLD-FRST-60. Easytrieve does not require the redefine be complete.
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 -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Increase the number of columns in the... IBM Tools 3
Search our Forums:

Back to Top