View previous topic :: View next topic
|
Author |
Message |
technut
New User
Joined: 27 Dec 2007 Posts: 73 Location: India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
technut
New User
Joined: 27 Dec 2007 Posts: 73 Location: India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
technut
New User
Joined: 27 Dec 2007 Posts: 73 Location: India
|
|
|
|
That's a nice idea.... Yeah as you said cobol is much better in this case!
Thanks a lot.. |
|
Back to top |
|
|
ameenansari
New User
Joined: 18 Sep 2006 Posts: 11 Location: chennai
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|