Re: [U2] Multi char delimiter in DICT item

2011-05-20 Thread Bob Woodward
I agree with you, John.  There has been many times that I've done exactly that 
and exactly for the reasons you state.  If the need would have been something 
that could have been used in other situations then I would have used a 
subroutine this time.  This need, though, was extremely narrow in scope and by 
keeping it as an I-desc formula, it was totally self contained, self 
documented, and is not in danger of, six months from now, having the 
calculations modified, potentially, inadvertently, changing the net results.

This group has so much deep knowledge that when I ask a question, I know that 
my thought processes are going to be either confirmed or expanded.  Thanks to 
everyone for sharing your expertise.

-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Israel, John R.
Sent: Friday, May 20, 2011 9:01 AM
To: 'U2 Users List'
Subject: Re: [U2] Multi char delimiter in DICT item

It is for this pain in the butt type of situation that I often call a 
subroutine to do my work.  I understand that part of the requirement was to try 
to avoid this, but I have had far too many situations where the I-Desc keeps 
getting more and more complicated to get the job done, only to find out that in 
the end, I need to do it with a subroutine any way.

When this happens, I try to be pro-active enough to anticipate that I will want 
to expand upon it later (maybe do different types of manipulations for the same 
data).  Thus, I pass the arguments that I know I need, plus several other that 
I do not need at them time, but can be used in the future as other uses or 
flavors are needed.

A complicated I-Desc can often be written as a simple subroutine.  Hours have 
been spent going back and forth on a solution to the original thread, where 10 
minute would likely have solved it by a subroutine.

Also, once the subroutine is written for the I-Desc, it can ALSO be called by 
normal program.  Imagine that.  1 piece of code that consistently returns a 
desired calculation throughout the system.  If a change is ever needed, fix it 
in the one subroutine, and it is solved everywhere.

Unless it is a REALLY simple I-Desc, go with a subroutine.

Just my 2 cents...


John Israel
Senior Programmer/Analyst
Dayton Superior Corporation
1125 Byers Road
Miamisburg, OH  45342


-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Martin Phillips
Sent: Friday, May 20, 2011 11:33 AM
To: dgr...@dagconsulting.com; U2 Users List
Subject: Re: [U2] Multi char delimiter in DICT item

Hi David,

> Bob is right.  Lets enhance the FIELD function to accept a string 
> delimiter
> and not just a single character.

A nice idea but it has to be a new function because FIELD() is defined as 
using only the first character of the supplied delimiter.

Because an enhancement such as this is unlikely to appear in time to resolve 
the original poster's problem, it should be possible to work around the 
issue by replacing all of the multi-character delimiters with some single 
character that would never appear in the data and then using FIELD() with 
this as the delimiter.

I cannot remember whether Unidata supports CHANGE() in I-types. For some 
strange reason UniVerse does not.


Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200 

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Multi char delimiter in DICT item

2011-05-20 Thread Israel, John R.
It is for this pain in the butt type of situation that I often call a 
subroutine to do my work.  I understand that part of the requirement was to try 
to avoid this, but I have had far too many situations where the I-Desc keeps 
getting more and more complicated to get the job done, only to find out that in 
the end, I need to do it with a subroutine any way.

When this happens, I try to be pro-active enough to anticipate that I will want 
to expand upon it later (maybe do different types of manipulations for the same 
data).  Thus, I pass the arguments that I know I need, plus several other that 
I do not need at them time, but can be used in the future as other uses or 
flavors are needed.

A complicated I-Desc can often be written as a simple subroutine.  Hours have 
been spent going back and forth on a solution to the original thread, where 10 
minute would likely have solved it by a subroutine.

Also, once the subroutine is written for the I-Desc, it can ALSO be called by 
normal program.  Imagine that.  1 piece of code that consistently returns a 
desired calculation throughout the system.  If a change is ever needed, fix it 
in the one subroutine, and it is solved everywhere.

Unless it is a REALLY simple I-Desc, go with a subroutine.

Just my 2 cents...


John Israel
Senior Programmer/Analyst
Dayton Superior Corporation
1125 Byers Road
Miamisburg, OH  45342


-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Martin Phillips
Sent: Friday, May 20, 2011 11:33 AM
To: dgr...@dagconsulting.com; U2 Users List
Subject: Re: [U2] Multi char delimiter in DICT item

Hi David,

> Bob is right.  Lets enhance the FIELD function to accept a string 
> delimiter
> and not just a single character.

A nice idea but it has to be a new function because FIELD() is defined as 
using only the first character of the supplied delimiter.

Because an enhancement such as this is unlikely to appear in time to resolve 
the original poster's problem, it should be possible to work around the 
issue by replacing all of the multi-character delimiters with some single 
character that would never appear in the data and then using FIELD() with 
this as the delimiter.

I cannot remember whether Unidata supports CHANGE() in I-types. For some 
strange reason UniVerse does not.


Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200 

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Multi char delimiter in DICT item

2011-05-20 Thread Bob Woodward
I'm not sure I would want a compile time error.  I can think of a couple
of situations where, though the use of a variable, the length of the
delimiter wouldn't be known until run time.  If there was a run time
message when the delimiter was multi-character, and an option to
suppress that message...  Maybe even an option to force the first
character usage like it does now...  Yeah, for my money that would be my
first choice.

I'm just glad you folks are smarter than I am and figured out a couple
of solutions that work!

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen
Sent: Friday, May 20, 2011 8:30 AM
To: dgr...@dagconsulting.com; U2 Users List
Subject: Re: [U2] Multi char delimiter in DICT item

or at least gripe about it at compile time. I got bit on this one in the
past
because I didn't realize it was only looking at the first character.

> -Original Message-
> From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> boun...@listserver.u2ug.org] On Behalf Of David A. Green
> Sent: Friday, May 20, 2011 11:23 AM
> To: 'U2 Users List'
> Subject: Re: [U2] Multi char delimiter in DICT item
> 
> Bob is right.  Lets enhance the FIELD function to accept a string
> delimiter
> and not just a single character.
> 
> David A. Green
> (480) 813-1725
> DAG Consulting
> 
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Multi char delimiter in DICT item

2011-05-20 Thread Martin Phillips

Hi David,

Bob is right.  Lets enhance the FIELD function to accept a string 
delimiter

and not just a single character.


A nice idea but it has to be a new function because FIELD() is defined as 
using only the first character of the supplied delimiter.


Because an enhancement such as this is unlikely to appear in time to resolve 
the original poster's problem, it should be possible to work around the 
issue by replacing all of the multi-character delimiters with some single 
character that would never appear in the data and then using FIELD() with 
this as the delimiter.


I cannot remember whether Unidata supports CHANGE() in I-types. For some 
strange reason UniVerse does not.



Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200 


___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Multi char delimiter in DICT item

2011-05-20 Thread George Gallen
or at least gripe about it at compile time. I got bit on this one in the past
because I didn't realize it was only looking at the first character.

> -Original Message-
> From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> boun...@listserver.u2ug.org] On Behalf Of David A. Green
> Sent: Friday, May 20, 2011 11:23 AM
> To: 'U2 Users List'
> Subject: Re: [U2] Multi char delimiter in DICT item
> 
> Bob is right.  Lets enhance the FIELD function to accept a string
> delimiter
> and not just a single character.
> 
> David A. Green
> (480) 813-1725
> DAG Consulting
> 
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Multi char delimiter in DICT item

2011-05-20 Thread David A. Green
Bob is right.  Lets enhance the FIELD function to accept a string delimiter
and not just a single character.

David A. Green
(480) 813-1725
DAG Consulting

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bob Woodward
Sent: Thursday, May 19, 2011 11:11 AM
To: U2 Users List
Subject: [U2] Multi char delimiter in DICT item

Hi folks,

I'm in Unidata 6.1 and I'm trying to find a way to use a multi character
value as a delimiter for a parsing function in an I-desc dict item.  I'm
working with Bartender label data records and I'm trying to parse the
first line on the "/PRN=" value, without the quote marks.  FIELD only
lets me use a single character.

What I have so far in the DICT item is:
001: I   
002: F1;FIELD(@1,'PRN=',2);FIELD(@2,'"',2)   
003: 
004: PRN 
005: 15L 
006: S   

This works great until a capital P is in the label name before the PRN.
Field is taking the first character and ignoring the RN=.  I do NOT want
to make a subroutine if I can avoid it.  I've tried using CHANGE to swap
out PRN= with a single character but apparently that's not an allowed
command in the DICT items.

Thanks for any help you can offer.

BobW

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Multi char delimiter in DICT item

2011-05-19 Thread Bob Woodward
I have to admit that I've never looked at MATCHFIELD before.  To be honest, I 
never would have gotten how to put the string together, either.  Seeing your 
solution and reading the HELP info, I see how it works.  Thanks very much Andy!

-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of andy baum
Sent: Thursday, May 19, 2011 2:39 PM
To: U2 Users List
Subject: Re: [U2] Multi char delimiter in DICT item

Or you can use :-


   MATCHFIELD(F1,\0X'PRN="'0X'"'0X\,3)


To directly extract the value. This works in Universe but not sure if Unidata 
supports the third (\) quote symbol. If not then you can use :-


   MATCHFIELD(F1,"0X'PRN=":'"':"'0X'":'"':"'0X",3)


Which is not quite as readable.


Cheers,

Andy



____________
From: Bob Woodward 
To: U2 Users List 
Sent: Thursday, 19 May 2011, 20:30
Subject: Re: [U2] Multi char delimiter in DICT item

WINNER  We can even remove the fourth statement since the third
statement puts the first quoted value at the front of @3 so...

F1 ; INDEX(F1,"PRN=",1) ; @1[@2,LEN(@1)] ; FIELD(@3,'"',2)

Will work perfectly!

Thank you very much!

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen
Sent: Thursday, May 19, 2011 12:22 PM
To: U2 Users List
Subject: Re: [U2] Multi char delimiter in DICT item

what about

F1 ; INDEX(F1,"PRN=",1) ; @1[@2,LEN(@1)] ; FIELD(@3,"=",2) ;
FIELD(@4,'"',2)

George

> -Original Message-
> From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> boun...@listserver.u2ug.org] On Behalf Of Bob Woodward
> Sent: Thursday, May 19, 2011 2:59 PM
> To: U2 Users List
> Subject: Re: [U2] Multi char delimiter in DICT item
> 
> That won't get me any closer.  Reason is that we have differing
numbers
> of options possible.  I really need to somehow identify where "PRN"
(or
> /PRN or PRN= or ...) is.  Once I have that, I can use FIELD on the
> double quotes to get what I want.
> 
> Double slashes won't work, either, as FIELD still just takes the first
> slash character and uses it.
> 
> Here's a sample of the data line I'm working with but, again, the
> number
> of options and option commands can change.  Only "/PRN=" is going to
be
> guaranteed to be unique to that data position. (The sample may wrap
but
> it's a single line.)
> 
> 001: %BTW% /RUN   /f="C:\BarTender\Template\Comply-FTL.btw"
> /d="\\ganymede\DCDOWN\5214411.dat" /p /PRN="BoxLabel3" /x
> 
> 
> Thanks,
> BobW
> 
> -Original Message-
> From: u2-users-boun...@listserver.u2ug.org
> [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George
> Gallen
> Sent: Thursday, May 19, 2011 11:46 AM
> To: U2 Users List
> Subject: Re: [U2] Multi char delimiter in DICT item
> 
> hmmm. looks like I need glasses...didn't see you already answered it.
> 
> Is there an = sign in any of the label data?
> 
> FIELD(@1,"=",2) ; FIELD(@2,'"'2)
> 
> Don't look for PRN= , just =
> 
> George
> 
> > -Original Message-
> > From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> > boun...@listserver.u2ug.org] On Behalf Of George Gallen
> > Sent: Thursday, May 19, 2011 2:30 PM
> > To: U2 Users List
> > Subject: Re: [U2] Multi char delimiter in DICT item
> >
> > Does CHANGE work with Unidata?
> >
> > CHANGE(F1,"PRN",CHAR(251)) ; FIELD(@1,CHAR(251),2) ; FIELD(@2,'"',2)
> >
> > George
> >
> > > -Original Message-
> > > From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> > > boun...@listserver.u2ug.org] On Behalf Of Bob Woodward
> > > Sent: Thursday, May 19, 2011 2:11 PM
> > > To: U2 Users List
> > > Subject: [U2] Multi char delimiter in DICT item
> > >
> > > Hi folks,
> > >
> > > I'm in Unidata 6.1 and I'm trying to find a way to use a multi
> > > character
> > > value as a delimiter for a parsing function in an I-desc dict
item.
> > > I'm
> > > working with Bartender label data records and I'm trying to parse
> the
> > > first line on the "/PRN=" value, without the quote marks.  FIELD
> only
> > > lets me use a single character.
> > >
> > > What I have so far in the DICT item is:
> > > 001: I
> > > 002: F1;FIELD(@1,'PRN=',2);FIELD(@2,&

Re: [U2] Multi char delimiter in DICT item

2011-05-19 Thread andy baum
Or you can use :-


   MATCHFIELD(F1,\0X'PRN="'0X'"'0X\,3)


To directly extract the value. This works in Universe but not sure if Unidata 
supports the third (\) quote symbol. If not then you can use :-


   MATCHFIELD(F1,"0X'PRN=":'"':"'0X'":'"':"'0X",3)


Which is not quite as readable.


Cheers,

Andy



____________
From: Bob Woodward 
To: U2 Users List 
Sent: Thursday, 19 May 2011, 20:30
Subject: Re: [U2] Multi char delimiter in DICT item

WINNER  We can even remove the fourth statement since the third
statement puts the first quoted value at the front of @3 so...

F1 ; INDEX(F1,"PRN=",1) ; @1[@2,LEN(@1)] ; FIELD(@3,'"',2)

Will work perfectly!

Thank you very much!

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen
Sent: Thursday, May 19, 2011 12:22 PM
To: U2 Users List
Subject: Re: [U2] Multi char delimiter in DICT item

what about

F1 ; INDEX(F1,"PRN=",1) ; @1[@2,LEN(@1)] ; FIELD(@3,"=",2) ;
FIELD(@4,'"',2)

George

> -Original Message-
> From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> boun...@listserver.u2ug.org] On Behalf Of Bob Woodward
> Sent: Thursday, May 19, 2011 2:59 PM
> To: U2 Users List
> Subject: Re: [U2] Multi char delimiter in DICT item
> 
> That won't get me any closer.  Reason is that we have differing
numbers
> of options possible.  I really need to somehow identify where "PRN"
(or
> /PRN or PRN= or ...) is.  Once I have that, I can use FIELD on the
> double quotes to get what I want.
> 
> Double slashes won't work, either, as FIELD still just takes the first
> slash character and uses it.
> 
> Here's a sample of the data line I'm working with but, again, the
> number
> of options and option commands can change.  Only "/PRN=" is going to
be
> guaranteed to be unique to that data position. (The sample may wrap
but
> it's a single line.)
> 
> 001: %BTW% /RUN   /f="C:\BarTender\Template\Comply-FTL.btw"
> /d="\\ganymede\DCDOWN\5214411.dat" /p /PRN="BoxLabel3" /x
> 
> 
> Thanks,
> BobW
> 
> -Original Message-
> From: u2-users-boun...@listserver.u2ug.org
> [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George
> Gallen
> Sent: Thursday, May 19, 2011 11:46 AM
> To: U2 Users List
> Subject: Re: [U2] Multi char delimiter in DICT item
> 
> hmmm. looks like I need glasses...didn't see you already answered it.
> 
> Is there an = sign in any of the label data?
> 
> FIELD(@1,"=",2) ; FIELD(@2,'"'2)
> 
> Don't look for PRN= , just =
> 
> George
> 
> > -Original Message-
> > From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> > boun...@listserver.u2ug.org] On Behalf Of George Gallen
> > Sent: Thursday, May 19, 2011 2:30 PM
> > To: U2 Users List
> > Subject: Re: [U2] Multi char delimiter in DICT item
> >
> > Does CHANGE work with Unidata?
> >
> > CHANGE(F1,"PRN",CHAR(251)) ; FIELD(@1,CHAR(251),2) ; FIELD(@2,'"',2)
> >
> > George
> >
> > > -Original Message-
> > > From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> > > boun...@listserver.u2ug.org] On Behalf Of Bob Woodward
> > > Sent: Thursday, May 19, 2011 2:11 PM
> > > To: U2 Users List
> > > Subject: [U2] Multi char delimiter in DICT item
> > >
> > > Hi folks,
> > >
> > > I'm in Unidata 6.1 and I'm trying to find a way to use a multi
> > > character
> > > value as a delimiter for a parsing function in an I-desc dict
item.
> > > I'm
> > > working with Bartender label data records and I'm trying to parse
> the
> > > first line on the "/PRN=" value, without the quote marks.  FIELD
> only
> > > lets me use a single character.
> > >
> > > What I have so far in the DICT item is:
> > > 001: I
> > > 002: F1;FIELD(@1,'PRN=',2);FIELD(@2,'"',2)
> > > 003:
> > > 004: PRN
> > > 005: 15L
> > > 006: S
> > >
> > > This works great until a capital P is in the label name before the
> > PRN.
> > > Field is taking the first character and ignoring the RN=.  I do
NOT
> > > want
> > > to make a subroutine if I can avoid it.  I've tried using CHANGE
to
> > > swap
> > > out PRN= with a single character but apparent

Re: [U2] Multi char delimiter in DICT item

2011-05-19 Thread Steve Romanow
Nice!

On Thu, May 19, 2011 at 3:30 PM, Bob Woodward  wrote:
> WINNER  We can even remove the fourth statement since the third
> statement puts the first quoted value at the front of @3 so...
>
> F1 ; INDEX(F1,"PRN=",1) ; @1[@2,LEN(@1)] ; FIELD(@3,'"',2)
>
> Will work perfectly!
>
> Thank you very much!
>
> -Original Message-
> From: u2-users-boun...@listserver.u2ug.org
> [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen
> Sent: Thursday, May 19, 2011 12:22 PM
> To: U2 Users List
> Subject: Re: [U2] Multi char delimiter in DICT item
>
> what about
>
> F1 ; INDEX(F1,"PRN=",1) ; @1[@2,LEN(@1)] ; FIELD(@3,"=",2) ;
> FIELD(@4,'"',2)
>
> George
>
>> -Original Message-
>> From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
>> boun...@listserver.u2ug.org] On Behalf Of Bob Woodward
>> Sent: Thursday, May 19, 2011 2:59 PM
>> To: U2 Users List
>> Subject: Re: [U2] Multi char delimiter in DICT item
>>
>> That won't get me any closer.  Reason is that we have differing
> numbers
>> of options possible.  I really need to somehow identify where "PRN"
> (or
>> /PRN or PRN= or ...) is.  Once I have that, I can use FIELD on the
>> double quotes to get what I want.
>>
>> Double slashes won't work, either, as FIELD still just takes the first
>> slash character and uses it.
>>
>> Here's a sample of the data line I'm working with but, again, the
>> number
>> of options and option commands can change.  Only "/PRN=" is going to
> be
>> guaranteed to be unique to that data position. (The sample may wrap
> but
>> it's a single line.)
>>
>> 001: %BTW% /RUN   /f="C:\BarTender\Template\Comply-FTL.btw"
>> /d="\\ganymede\DCDOWN\5214411.dat" /p /PRN="BoxLabel3" /x
>>
>>
>> Thanks,
>> BobW
>>
>> -Original Message-
>> From: u2-users-boun...@listserver.u2ug.org
>> [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George
>> Gallen
>> Sent: Thursday, May 19, 2011 11:46 AM
>> To: U2 Users List
>> Subject: Re: [U2] Multi char delimiter in DICT item
>>
>> hmmm. looks like I need glasses...didn't see you already answered it.
>>
>> Is there an = sign in any of the label data?
>>
>> FIELD(@1,"=",2) ; FIELD(@2,'"'2)
>>
>> Don't look for PRN= , just =
>>
>> George
>>
>> > -Original Message-
>> > From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
>> > boun...@listserver.u2ug.org] On Behalf Of George Gallen
>> > Sent: Thursday, May 19, 2011 2:30 PM
>> > To: U2 Users List
>> > Subject: Re: [U2] Multi char delimiter in DICT item
>> >
>> > Does CHANGE work with Unidata?
>> >
>> > CHANGE(F1,"PRN",CHAR(251)) ; FIELD(@1,CHAR(251),2) ; FIELD(@2,'"',2)
>> >
>> > George
>> >
>> > > -Original Message-
>> > > From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
>> > > boun...@listserver.u2ug.org] On Behalf Of Bob Woodward
>> > > Sent: Thursday, May 19, 2011 2:11 PM
>> > > To: U2 Users List
>> > > Subject: [U2] Multi char delimiter in DICT item
>> > >
>> > > Hi folks,
>> > >
>> > > I'm in Unidata 6.1 and I'm trying to find a way to use a multi
>> > > character
>> > > value as a delimiter for a parsing function in an I-desc dict
> item.
>> > > I'm
>> > > working with Bartender label data records and I'm trying to parse
>> the
>> > > first line on the "/PRN=" value, without the quote marks.  FIELD
>> only
>> > > lets me use a single character.
>> > >
>> > > What I have so far in the DICT item is:
>> > > 001: I
>> > > 002: F1;FIELD(@1,'PRN=',2);FIELD(@2,'"',2)
>> > > 003:
>> > > 004: PRN
>> > > 005: 15L
>> > > 006: S
>> > >
>> > > This works great until a capital P is in the label name before the
>> > PRN.
>> > > Field is taking the first character and ignoring the RN=.  I do
> NOT
>> > > want
>> > > to make a subroutine if I can avoid it.  I've tried using CHANGE
> to
>> > > swap
>> > > out PRN= with a single character but apparently th

Re: [U2] Multi char delimiter in DICT item

2011-05-19 Thread Bob Woodward
WINNER  We can even remove the fourth statement since the third
statement puts the first quoted value at the front of @3 so...

F1 ; INDEX(F1,"PRN=",1) ; @1[@2,LEN(@1)] ; FIELD(@3,'"',2)

Will work perfectly!

Thank you very much!

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen
Sent: Thursday, May 19, 2011 12:22 PM
To: U2 Users List
Subject: Re: [U2] Multi char delimiter in DICT item

what about

F1 ; INDEX(F1,"PRN=",1) ; @1[@2,LEN(@1)] ; FIELD(@3,"=",2) ;
FIELD(@4,'"',2)

George

> -Original Message-
> From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> boun...@listserver.u2ug.org] On Behalf Of Bob Woodward
> Sent: Thursday, May 19, 2011 2:59 PM
> To: U2 Users List
> Subject: Re: [U2] Multi char delimiter in DICT item
> 
> That won't get me any closer.  Reason is that we have differing
numbers
> of options possible.  I really need to somehow identify where "PRN"
(or
> /PRN or PRN= or ...) is.  Once I have that, I can use FIELD on the
> double quotes to get what I want.
> 
> Double slashes won't work, either, as FIELD still just takes the first
> slash character and uses it.
> 
> Here's a sample of the data line I'm working with but, again, the
> number
> of options and option commands can change.  Only "/PRN=" is going to
be
> guaranteed to be unique to that data position. (The sample may wrap
but
> it's a single line.)
> 
> 001: %BTW% /RUN   /f="C:\BarTender\Template\Comply-FTL.btw"
> /d="\\ganymede\DCDOWN\5214411.dat" /p /PRN="BoxLabel3" /x
> 
> 
> Thanks,
> BobW
> 
> -----Original Message-
> From: u2-users-boun...@listserver.u2ug.org
> [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George
> Gallen
> Sent: Thursday, May 19, 2011 11:46 AM
> To: U2 Users List
> Subject: Re: [U2] Multi char delimiter in DICT item
> 
> hmmm. looks like I need glasses...didn't see you already answered it.
> 
> Is there an = sign in any of the label data?
> 
> FIELD(@1,"=",2) ; FIELD(@2,'"'2)
> 
> Don't look for PRN= , just =
> 
> George
> 
> > -Original Message-
> > From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> > boun...@listserver.u2ug.org] On Behalf Of George Gallen
> > Sent: Thursday, May 19, 2011 2:30 PM
> > To: U2 Users List
> > Subject: Re: [U2] Multi char delimiter in DICT item
> >
> > Does CHANGE work with Unidata?
> >
> > CHANGE(F1,"PRN",CHAR(251)) ; FIELD(@1,CHAR(251),2) ; FIELD(@2,'"',2)
> >
> > George
> >
> > > -Original Message-
> > > From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> > > boun...@listserver.u2ug.org] On Behalf Of Bob Woodward
> > > Sent: Thursday, May 19, 2011 2:11 PM
> > > To: U2 Users List
> > > Subject: [U2] Multi char delimiter in DICT item
> > >
> > > Hi folks,
> > >
> > > I'm in Unidata 6.1 and I'm trying to find a way to use a multi
> > > character
> > > value as a delimiter for a parsing function in an I-desc dict
item.
> > > I'm
> > > working with Bartender label data records and I'm trying to parse
> the
> > > first line on the "/PRN=" value, without the quote marks.  FIELD
> only
> > > lets me use a single character.
> > >
> > > What I have so far in the DICT item is:
> > > 001: I
> > > 002: F1;FIELD(@1,'PRN=',2);FIELD(@2,'"',2)
> > > 003:
> > > 004: PRN
> > > 005: 15L
> > > 006: S
> > >
> > > This works great until a capital P is in the label name before the
> > PRN.
> > > Field is taking the first character and ignoring the RN=.  I do
NOT
> > > want
> > > to make a subroutine if I can avoid it.  I've tried using CHANGE
to
> > > swap
> > > out PRN= with a single character but apparently that's not an
> allowed
> > > command in the DICT items.
> > >
> > > Thanks for any help you can offer.
> > >
> > > BobW
> > >
> > > ___
> > > U2-Users mailing list
> > > U2-Users@listserver.u2ug.org
> > > http://listserver.u2ug.org/mailman/listinfo/u2-users
> > ___
> > U2-Users mailing list
> > U2-Users@listserver.u2ug.org
> > http://listserver.u2ug.org/mailman/listinfo/u2-users
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Multi char delimiter in DICT item

2011-05-19 Thread George Gallen
what about

F1 ; INDEX(F1,"PRN=",1) ; @1[@2,LEN(@1)] ; FIELD(@3,"=",2) ; FIELD(@4,'"',2)

George

> -Original Message-
> From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> boun...@listserver.u2ug.org] On Behalf Of Bob Woodward
> Sent: Thursday, May 19, 2011 2:59 PM
> To: U2 Users List
> Subject: Re: [U2] Multi char delimiter in DICT item
> 
> That won't get me any closer.  Reason is that we have differing numbers
> of options possible.  I really need to somehow identify where "PRN" (or
> /PRN or PRN= or ...) is.  Once I have that, I can use FIELD on the
> double quotes to get what I want.
> 
> Double slashes won't work, either, as FIELD still just takes the first
> slash character and uses it.
> 
> Here's a sample of the data line I'm working with but, again, the
> number
> of options and option commands can change.  Only "/PRN=" is going to be
> guaranteed to be unique to that data position. (The sample may wrap but
> it's a single line.)
> 
> 001: %BTW% /RUN   /f="C:\BarTender\Template\Comply-FTL.btw"
> /d="\\ganymede\DCDOWN\5214411.dat" /p /PRN="BoxLabel3" /x
> 
> 
> Thanks,
> BobW
> 
> -Original Message-
> From: u2-users-boun...@listserver.u2ug.org
> [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George
> Gallen
> Sent: Thursday, May 19, 2011 11:46 AM
> To: U2 Users List
> Subject: Re: [U2] Multi char delimiter in DICT item
> 
> hmmm. looks like I need glasses...didn't see you already answered it.
> 
> Is there an = sign in any of the label data?
> 
> FIELD(@1,"=",2) ; FIELD(@2,'"'2)
> 
> Don't look for PRN= , just =
> 
> George
> 
> > -Original Message-
> > From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> > boun...@listserver.u2ug.org] On Behalf Of George Gallen
> > Sent: Thursday, May 19, 2011 2:30 PM
> > To: U2 Users List
> > Subject: Re: [U2] Multi char delimiter in DICT item
> >
> > Does CHANGE work with Unidata?
> >
> > CHANGE(F1,"PRN",CHAR(251)) ; FIELD(@1,CHAR(251),2) ; FIELD(@2,'"',2)
> >
> > George
> >
> > > -Original Message-
> > > From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> > > boun...@listserver.u2ug.org] On Behalf Of Bob Woodward
> > > Sent: Thursday, May 19, 2011 2:11 PM
> > > To: U2 Users List
> > > Subject: [U2] Multi char delimiter in DICT item
> > >
> > > Hi folks,
> > >
> > > I'm in Unidata 6.1 and I'm trying to find a way to use a multi
> > > character
> > > value as a delimiter for a parsing function in an I-desc dict item.
> > > I'm
> > > working with Bartender label data records and I'm trying to parse
> the
> > > first line on the "/PRN=" value, without the quote marks.  FIELD
> only
> > > lets me use a single character.
> > >
> > > What I have so far in the DICT item is:
> > > 001: I
> > > 002: F1;FIELD(@1,'PRN=',2);FIELD(@2,'"',2)
> > > 003:
> > > 004: PRN
> > > 005: 15L
> > > 006: S
> > >
> > > This works great until a capital P is in the label name before the
> > PRN.
> > > Field is taking the first character and ignoring the RN=.  I do NOT
> > > want
> > > to make a subroutine if I can avoid it.  I've tried using CHANGE to
> > > swap
> > > out PRN= with a single character but apparently that's not an
> allowed
> > > command in the DICT items.
> > >
> > > Thanks for any help you can offer.
> > >
> > > BobW
> > >
> > > ___
> > > U2-Users mailing list
> > > U2-Users@listserver.u2ug.org
> > > http://listserver.u2ug.org/mailman/listinfo/u2-users
> > ___
> > U2-Users mailing list
> > U2-Users@listserver.u2ug.org
> > http://listserver.u2ug.org/mailman/listinfo/u2-users
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Multi char delimiter in DICT item

2011-05-19 Thread Bob Woodward
Again, I have a variable number of options.  If I could do a FOR...NEXT
in a DICT item then that would work.  Thanks, though.

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Steve Romanow
Sent: Thursday, May 19, 2011 12:03 PM
To: U2 Users List
Subject: Re: [U2] Multi char delimiter in DICT item

Maybe swap / for @am and you have tokenized your input.
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Multi char delimiter in DICT item

2011-05-19 Thread Steve Romanow
Maybe swap / for @am and you have tokenized your input.
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Multi char delimiter in DICT item

2011-05-19 Thread Bob Woodward
That won't get me any closer.  Reason is that we have differing numbers
of options possible.  I really need to somehow identify where "PRN" (or
/PRN or PRN= or ...) is.  Once I have that, I can use FIELD on the
double quotes to get what I want.

Double slashes won't work, either, as FIELD still just takes the first
slash character and uses it.

Here's a sample of the data line I'm working with but, again, the number
of options and option commands can change.  Only "/PRN=" is going to be
guaranteed to be unique to that data position. (The sample may wrap but
it's a single line.)

001: %BTW% /RUN   /f="C:\BarTender\Template\Comply-FTL.btw"
/d="\\ganymede\DCDOWN\5214411.dat" /p /PRN="BoxLabel3" /x


Thanks,
BobW

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen
Sent: Thursday, May 19, 2011 11:46 AM
To: U2 Users List
Subject: Re: [U2] Multi char delimiter in DICT item

hmmm. looks like I need glasses...didn't see you already answered it.

Is there an = sign in any of the label data?

FIELD(@1,"=",2) ; FIELD(@2,'"'2)

Don't look for PRN= , just =

George

> -Original Message-
> From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> boun...@listserver.u2ug.org] On Behalf Of George Gallen
> Sent: Thursday, May 19, 2011 2:30 PM
> To: U2 Users List
> Subject: Re: [U2] Multi char delimiter in DICT item
> 
> Does CHANGE work with Unidata?
> 
> CHANGE(F1,"PRN",CHAR(251)) ; FIELD(@1,CHAR(251),2) ; FIELD(@2,'"',2)
> 
> George
> 
> > -Original Message-
> > From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> > boun...@listserver.u2ug.org] On Behalf Of Bob Woodward
> > Sent: Thursday, May 19, 2011 2:11 PM
> > To: U2 Users List
> > Subject: [U2] Multi char delimiter in DICT item
> >
> > Hi folks,
> >
> > I'm in Unidata 6.1 and I'm trying to find a way to use a multi
> > character
> > value as a delimiter for a parsing function in an I-desc dict item.
> > I'm
> > working with Bartender label data records and I'm trying to parse
the
> > first line on the "/PRN=" value, without the quote marks.  FIELD
only
> > lets me use a single character.
> >
> > What I have so far in the DICT item is:
> > 001: I
> > 002: F1;FIELD(@1,'PRN=',2);FIELD(@2,'"',2)
> > 003:
> > 004: PRN
> > 005: 15L
> > 006: S
> >
> > This works great until a capital P is in the label name before the
> PRN.
> > Field is taking the first character and ignoring the RN=.  I do NOT
> > want
> > to make a subroutine if I can avoid it.  I've tried using CHANGE to
> > swap
> > out PRN= with a single character but apparently that's not an
allowed
> > command in the DICT items.
> >
> > Thanks for any help you can offer.
> >
> > BobW
> >
> > ___
> > U2-Users mailing list
> > U2-Users@listserver.u2ug.org
> > http://listserver.u2ug.org/mailman/listinfo/u2-users
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Multi char delimiter in DICT item

2011-05-19 Thread George Gallen
hmmm. looks like I need glasses...didn't see you already answered it.

Is there an = sign in any of the label data?

FIELD(@1,"=",2) ; FIELD(@2,'"'2)

Don't look for PRN= , just =

George

> -Original Message-
> From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> boun...@listserver.u2ug.org] On Behalf Of George Gallen
> Sent: Thursday, May 19, 2011 2:30 PM
> To: U2 Users List
> Subject: Re: [U2] Multi char delimiter in DICT item
> 
> Does CHANGE work with Unidata?
> 
> CHANGE(F1,"PRN",CHAR(251)) ; FIELD(@1,CHAR(251),2) ; FIELD(@2,'"',2)
> 
> George
> 
> > -Original Message-
> > From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> > boun...@listserver.u2ug.org] On Behalf Of Bob Woodward
> > Sent: Thursday, May 19, 2011 2:11 PM
> > To: U2 Users List
> > Subject: [U2] Multi char delimiter in DICT item
> >
> > Hi folks,
> >
> > I'm in Unidata 6.1 and I'm trying to find a way to use a multi
> > character
> > value as a delimiter for a parsing function in an I-desc dict item.
> > I'm
> > working with Bartender label data records and I'm trying to parse the
> > first line on the "/PRN=" value, without the quote marks.  FIELD only
> > lets me use a single character.
> >
> > What I have so far in the DICT item is:
> > 001: I
> > 002: F1;FIELD(@1,'PRN=',2);FIELD(@2,'"',2)
> > 003:
> > 004: PRN
> > 005: 15L
> > 006: S
> >
> > This works great until a capital P is in the label name before the
> PRN.
> > Field is taking the first character and ignoring the RN=.  I do NOT
> > want
> > to make a subroutine if I can avoid it.  I've tried using CHANGE to
> > swap
> > out PRN= with a single character but apparently that's not an allowed
> > command in the DICT items.
> >
> > Thanks for any help you can offer.
> >
> > BobW
> >
> > ___
> > U2-Users mailing list
> > U2-Users@listserver.u2ug.org
> > http://listserver.u2ug.org/mailman/listinfo/u2-users
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Multi char delimiter in DICT item

2011-05-19 Thread Steve Romanow
Does doubling the slash help?  "//PRD"

On Thu, May 19, 2011 at 2:11 PM, Bob Woodward  wrote:
> Hi folks,
>
> I'm in Unidata 6.1 and I'm trying to find a way to use a multi character
> value as a delimiter for a parsing function in an I-desc dict item.  I'm
> working with Bartender label data records and I'm trying to parse the
> first line on the "/PRN=" value, without the quote marks.  FIELD only
> lets me use a single character.
>
> What I have so far in the DICT item is:
> 001: I
> 002: F1;FIELD(@1,'PRN=',2);FIELD(@2,'"',2)
> 003:
> 004: PRN
> 005: 15L
> 006: S
>
> This works great until a capital P is in the label name before the PRN.
> Field is taking the first character and ignoring the RN=.  I do NOT want
> to make a subroutine if I can avoid it.  I've tried using CHANGE to swap
> out PRN= with a single character but apparently that's not an allowed
> command in the DICT items.
>
> Thanks for any help you can offer.
>
> BobW
>
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
>
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Multi char delimiter in DICT item

2011-05-19 Thread Richard A. Wilson

how about INDEX then you should be able to use C0L1 COL2 logic

or what I did years ago for CONVERT since it wasnt allowed to
be used in an Itype was create a generic subroutine that could
be used as a SUBR where ever I needed it

something like
SUBR('*CONVERT.SUBR',@RECORD<1>,from delim,to delim)

Rich

Bob Woodward wrote:

Hi folks,

I'm in Unidata 6.1 and I'm trying to find a way to use a multi character
value as a delimiter for a parsing function in an I-desc dict item.  I'm
working with Bartender label data records and I'm trying to parse the
first line on the "/PRN=" value, without the quote marks.  FIELD only
lets me use a single character.

What I have so far in the DICT item is:
001: I   
002: F1;FIELD(@1,'PRN=',2);FIELD(@2,'"',2)   
003: 
004: PRN 
005: 15L 
006: S   


This works great until a capital P is in the label name before the PRN.
Field is taking the first character and ignoring the RN=.  I do NOT want
to make a subroutine if I can avoid it.  I've tried using CHANGE to swap
out PRN= with a single character but apparently that's not an allowed
command in the DICT items.

Thanks for any help you can offer.

BobW

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users



--
Richard A Wilson
Lakeside Systems
Smithfield, RI, USA
Voice 401-231-3959
Fax   206-202-2064
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Multi char delimiter in DICT item

2011-05-19 Thread George Gallen
Does CHANGE work with Unidata?

CHANGE(F1,"PRN",CHAR(251)) ; FIELD(@1,CHAR(251),2) ; FIELD(@2,'"',2)

George

> -Original Message-
> From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> boun...@listserver.u2ug.org] On Behalf Of Bob Woodward
> Sent: Thursday, May 19, 2011 2:11 PM
> To: U2 Users List
> Subject: [U2] Multi char delimiter in DICT item
> 
> Hi folks,
> 
> I'm in Unidata 6.1 and I'm trying to find a way to use a multi
> character
> value as a delimiter for a parsing function in an I-desc dict item.
> I'm
> working with Bartender label data records and I'm trying to parse the
> first line on the "/PRN=" value, without the quote marks.  FIELD only
> lets me use a single character.
> 
> What I have so far in the DICT item is:
> 001: I
> 002: F1;FIELD(@1,'PRN=',2);FIELD(@2,'"',2)
> 003:
> 004: PRN
> 005: 15L
> 006: S
> 
> This works great until a capital P is in the label name before the PRN.
> Field is taking the first character and ignoring the RN=.  I do NOT
> want
> to make a subroutine if I can avoid it.  I've tried using CHANGE to
> swap
> out PRN= with a single character but apparently that's not an allowed
> command in the DICT items.
> 
> Thanks for any help you can offer.
> 
> BobW
> 
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


[U2] Multi char delimiter in DICT item

2011-05-19 Thread Bob Woodward
Hi folks,

I'm in Unidata 6.1 and I'm trying to find a way to use a multi character
value as a delimiter for a parsing function in an I-desc dict item.  I'm
working with Bartender label data records and I'm trying to parse the
first line on the "/PRN=" value, without the quote marks.  FIELD only
lets me use a single character.

What I have so far in the DICT item is:
001: I   
002: F1;FIELD(@1,'PRN=',2);FIELD(@2,'"',2)   
003: 
004: PRN 
005: 15L 
006: S   

This works great until a capital P is in the label name before the PRN.
Field is taking the first character and ignoring the RN=.  I do NOT want
to make a subroutine if I can avoid it.  I've tried using CHANGE to swap
out PRN= with a single character but apparently that's not an allowed
command in the DICT items.

Thanks for any help you can offer.

BobW

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users