Jump to content

Is anyone aware of a way to return specific parts of a Descr...


Nicholas Boyer

Recommended Posts

nicholas.boyer:

 

Advocate Reward - 11111111111

 

 

Take a look at the token function:

DEFINE FILE CAR

MYFIELD/A50=Advocate Reward - 11111111111;

MYFIELD_LEFT/A50=TOKEN(MYFIELD, - ,1);

MYFIELD_RIGHT/A50=TOKEN(MYFIELD, - ',-1);

END

TABLE FILE CAR

PRINT MYFIELD MYFIELD_LEFT MYFIELD_RIGHT

BY COUNTRY

WHERE RECORDLIMIT EQ 1

END

If you dont see the token function there is also an older GETTOK function which will require more parameters:

MYFIELD_LEFT/A50=GETTOK(MYFIELD,50,1,-,50,A50);

MYFIELD_RIGHT/A50=GETTOK(MYFIELD,50,-1,-,50,A50);

Walter

Link to comment
Share on other sites

Walter,

Must use the below code otherwise this error is displayed :

 

DEFINE FILE CAR

MYFIELD /A50V = 'Advocate Reward - 11111111111';

MYFIELD_LEFT /A50V = TOKEN(MYFIELD, '-', 1);

MYFIELD_RIGHT /A50V = TOKEN(MYFIELD, '-',-1);

END

TABLE FILE CAR

PRINT MYFIELD

MYFIELD_LEFT

MYFIELD_RIGHT

BY COUNTRY

WHERE RECORDLIMIT EQ 1

END

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...