View previous topic :: View next topic
|
Author |
Message |
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
Hi,
My variable :
VAR-1 125AUI85F
I want to move value 125AUI into another variable.
When i am using
MOVE VAR-1(1:6) to VAR-2
but while compiling i am facing following error:
B118 NAME MISSING
VAR-1
B027 NOT A VALID NAME - 6
Is it possible to use referencing in EZT.
Regards,
Krunal |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Why don't you read the manual for your release? It is good practice to check the manual before inventing syntax, obviates the need to actually do the inventing (so, conceptualise and find out if syntax exists/what it is for your concept).
Better:
Code: |
VAR-1 125 A
some-other-really-dumb-and-meaningless-name VAR-1 6 A
VAR-2 = some-other-really-dumb-and-meaningless-name |
Or, if VAR-2 happens to be length of six,
|
|
Back to top |
|
|
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
Hi Bill,
My var-2 length keeps on changing depending upon the situation.
I know the creation of the sub elements. but in my case the sub elements will not work.
Regards,
Krunal Bafna |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
and what about using a more intelligent title ? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Because? You show fixed position and length on your fake reference-modification, I don't see how that can't be reflected in data definition. |
|
Back to top |
|
|
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
Hi Bill , Enricho,
Thanks for the information and updates.
Like Cobol it is not possible to move part of variable into another working storage variable in Eazytrieve. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Why, instead of answering my question, did you come up with that cryptic line?
You have shown a fixed starting position and a fixed length. Do it with the data, or, since the start position is 1, by the length of "VAR-2". If you have something different, you have to say so.
Now, read what you wrote in your previous, and re-write it so that it can be understood by someone who doesn't already know what it says, please. |
|
Back to top |
|
|
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
Hi,
My variable :
VAR-1 125AUI85F
I want to move value 125AUI into another variable. The value to be moved into varible-2 varies depending upon condition.
Cond-1 move first 5 character.
cond-2 move first 6 character
Cond-2 move first 8 character.
When i am using
MOVE VAR-1(1:ws-value) to VAR-2
but while compiling i am facing following error:
B118 NAME MISSING
VAR-1
B027 NOT A VALID NAME - ws-value
Is it possible to use referencing in EZT. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Bill Woodger wrote: |
Why don't you read the manual for your release? It is good practice to check the manual before inventing syntax, obviates the need to actually do the inventing (so, conceptualise and find out if syntax exists/what it is for your concept).
Better:
Code: |
VAR-1 125 A
some-other-really-dumb-and-meaningless-name VAR-1 6 A
VAR-2 = some-other-really-dumb-and-meaningless-name |
[...]
|
Let's invent a length for VAR-1, as what I was taking as the length is part of your data, and you didn't bother to show your definition.
Code: |
really-really-lazy-name-for-a-field 1 30 A
another-lazy-name-field-length-5 really-really-lazy-name-for-a-field 5 A
another-lazy-name-field-length-6 really-really-lazy-name-for-a-field 6 A
another-lazy-name-field-length-8 really-really-lazy-name-for-a-field 8 A |
Code: |
VAR-2 = another-lazy-name-field-length-8 |
Or -5, or -6, depending on your condition.
If you have lots of fields of different lengths, all starting from the first position, then there is a way to do it, which has been documented in the manuals since at least 1984.
If you want to just be lazy and obscure in your code with three fields, you have at least find out how to do it for yourself. Read the Fine Manual. |
|
Back to top |
|
|
|