If I follow your question:

001 PQN
002 MV %1 "XX*YYYNN"
003 O------------------------------
004 T "Input value:",%1
005 T "Desired output:",%1:G1*1:
006 S2
007 IH%1:G1*1:
008 T "Current content of %2:",%2

This will place 'YYYNN' into buffer %2

... david ...

David L. Waz
Pick Professionals, Inc.

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of John Jenkins
Sent: Thursday, May 10, 2012 4:48 PM
To: U2 Users List
Cc: U2 Users List
Subject: Re: [U2] Proc question

I use PQN PROCs regularly, including indirect buffer references (subscripts) 
and select buffer manipulation, UniData and UniVerse do have significant 
differences though. MV for primary and secondary input and output buffers is a 
staple, but sometimes the older style A\ and similar become invaluable.

PROC on!

The Jonathan Sisk references are a good start, I learned on Reality way back. I 
do recall a PL system being written in PROC at one time - and no, The 
explanation why is too improbable to believe, so I'll spare you.

Regards

JayJay



On 10 May 2012, at 04:27, Ed Clark <u...@edclark.net> wrote:

> PQN procs are supported in unidata for sure. Just wasn't sure if the 
> conversions on the MV command work there.
> 
> You can use the universe proverb documentation as a starting point for 
> working with procs in unidata, but there are a lot of differences, including 
> some fundamental ones. For example, both PQ and PQN proc on universe use 
> attribute marks to delimit fields in the buffers, but PQ proc in unidata uses 
> the "standard" space delimiters.    The universe proverb manual doesn't 
> mention conversions on the MV command
> 
> On May 9, 2012, at 11:23 AM, Brenda Ives wrote:
> 
>> Guide to ProVerb - UniVerse proc documentation.
>> 
>> Brenda L Ives
>> UniVerse Team Lead
>> Rapid Response Team 
>> marketamerica.com/SHOP.COM
>> Greensboro, NC
>> 336-389-5950
>> 
>> RRT Team Red
>> 
>> 
>> -----Original Message-----
>> From: u2-users-boun...@listserver.u2ug.org 
>> [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Kebbon Irwin
>> Sent: Wednesday, May 09, 2012 11:05 AM
>> To: u2-users@listserver.u2ug.org
>> Subject: Re: [U2] Proc question
>> 
>> 
>> Hi Ed,I am pretty sure that PQN procs are supported in Unidata, I have never 
>> used them or seen a manual for them.  Like you I have not found anything in 
>> the udtdocs that addresses Proc either....Kebbon
>> 
>>> From: u...@edclark.net
>>> Date: Mon, 7 May 2012 22:58:31 -0400
>>> To: u2-users@listserver.u2ug.org
>>> Subject: Re: [U2] Proc question
>>> 
>>> 
>>> On May 7, 2012, at 4:45 PM, Kebbon Irwin wrote:
>>> 
>>>> 
>>>> Anyone know/remember how to do this:I have a string in my input buffer 
>>>> XX*YYYNNI want to place just YYYNN in my output bufferI feel I should be 
>>>> able to do this without writing my own user mode or a program that does a 
>>>> procread/procwrite....Thanks,Kebbon
>>>> Unidata 7.1 Ecltype P                         
>>>> _______________________________________________
>>>> U2-Users mailing list
>>>> U2-Users@listserver.u2ug.org
>>>> http://listserver.u2ug.org/mailman/listinfo/u2-users
>>> 
>>> I don't know if unidata supports this (has anyone ever seen a unidata proc 
>>> manual?) but in PQN proc on Reality, the MV command can apply a conversion:
>>> 
>>> MV
>>> 
>>> Purpose
>>> 
>>> To copy data between the input buffer, output buffers, file buffers and 
>>> select registers.
>>> 
>>> Syntax
>>> 
>>> MV destination source{,source}...{,*{n}}{,_}
>>> 
>>> or
>>> 
>>> MV destination source{*source}...
>>> 
>>> Syntax Elements
>>> 
>>> destination            is a direct or indirect reference to a buffer or 
>>> select register that you want the data copied to. If the destination is a 
>>> select register, the source can only be a direct or indirect reference to a 
>>> file buffer.
>>> 
>>> source                   is the data you want to copy. The source can be:
>>> 
>>> *      a direct or indirect reference to a buffer or select register that 
>>> contains the data you want to copy.
>>> 
>>> *      a direct or indirect reference to a buffer followed by 
>>> ';input-conversion;' or ':output-conversion:'. See the topic English 
>>> Conversions for details.
>>> 
>>> *        a string of zero or more characters enclosed in single or double 
>>> quotes. An uneven number of quotes now gives a syntax error.
>>> 
>>> *        a SYSTEM function that returns system/database information.
>>> 
>>> *      a single character expressed in one of two ways:
>>> 
>>> Xx    where x is a hexadecimal number in the range 00 to FF. Thus, XFD is a 
>>> value mark.
>>> 
>>> In     where n is a decimal number in the range 0 to 255. Thus, I253 is a 
>>> value mark.
>>> 
>>> ,*                           copies all source parameters starting with the 
>>> specified parameter. The destination buffer or select register is truncated 
>>> after the last parameter is copied if * is the last operand in the source 
>>> field.
>>> 
>>> ,*n                         copies n further source parameters following 
>>> (and in addition to) the specified parameter.
>>> 
>>> ,_                          specifies that the destination is truncated 
>>> after the source is copied.
>>> 
>>> *source                  concatenates the source values into one attribute 
>>> in the destination.
>>> 
>>> Select Register Destination
>>> 
>>> If you use a select register as the destination, then the only valid source 
>>> is a direct or indirect reference to a file buffer. For example:
>>> 
>>> MV !1 &5.9  or  MV !3 &3.%1
>>> 
>>> Creating Null Attributes or Parameters
>>> 
>>> If the attribute or parameter number in destination is larger than the 
>>> current number of attributes or parameters, the Proc processor 
>>> automatically creates null values to space out to the requested location.
>>> 
>>> If the source is a literal string containing just two double quotes, then 
>>> the destination is nulled.
>>> 
>>> Input Buffer Pointer
>>> 
>>> If you reference the primary input buffer as the destination, that buffer 
>>> is selected as active and the buffer pointer is positioned at the beginning 
>>> of the moved string.
>>> 
>>> Copying a Series of Values
>>> 
>>> If you give a series of values as the source, the first value is copied 
>>> into the destination, and each subsequent source value is copied to a 
>>> successive location in the destination buffer. For example:
>>> 
>>> MV %2 &2.7,"ABC",!2
>>> 
>>> copies attribute 7 of file buffer 2, the string "ABC", and the next value 
>>> from select register 2 into the 2nd, 3rd, and 4th parameters of the primary 
>>> input buffer.
>>> 
>>> Preserving Parameters/
>>> Attributes
>>> 
>>> If you want to change more than one attribute or parameter without changing 
>>> the attributes or parameters in between, you must use commas in the source 
>>> field to preserve those attributes or parameters.
>>> 
>>> For example, if the primary input buffer contains ABC^DEF^GHI^JKL, and you 
>>> issue the following command,
>>> 
>>> MV %1 "XX",,,"9999"
>>> 
>>> the result is XX^DEF^GHI^9999. The command replaces the 1st and 4th 
>>> parameters with new values, leaving the 2nd and 3rd parameters unaltered.
>>> 
>>> Concatenation
>>> 
>>> If you separate a series of source values with asterisks (*) instead of 
>>> commas, the source values are concatenated into one attribute in the 
>>> destination. For example:
>>> 
>>> MV %2 &1.7*"TEXT"*%4
>>> 
>>> concatenates the 4th attribute of the primary input buffer to the string 
>>> "TEXT", then concatenates that result to attribute 7 of file buffer 1, then 
>>> copies the result as a single parameter into the 2nd parameter of the 
>>> primary input buffer.
>>> 
>>> Truncation
>>> 
>>> If you specify an underline (_) as the last item in the source field, the 
>>> specified destination is truncated after the last source is copied.
>>> 
>>> Copying the Entire Contents of a Buffer
>>> 
>>> If you specify an asterisk (*) as the last item in a source field, all 
>>> attributes or parameters starting with the specified attribute or parameter 
>>> are copied. For example:
>>> 
>>> MV &2.1 %10,*
>>> 
>>> copies the 10th parameter of the primary input buffer to attribute 1 of 
>>> file buffer 2. It also copies parameter 11 of the primary input buffer to 
>>> attribute 2 of file buffer 2, and so on. The remainder of file buffer 2 is 
>>> truncated after the last parameter of the primary input buffer is copied.
>>> 
>>> Copying a Series of Attributes
>>> 
>>> If you specify an asterisk followed by an integer (*n) as a source field 
>>> element, the number of attributes or parameters specified by n are copied 
>>> in addition to the specified attribute or parameter. For example:
>>> 
>>> MV &2.3 %4,*3
>>> 
>>> copies the 4th, 5th, 6th and 7th parameters of the primary input buffer to 
>>> attributes 3, 4, 5 and 6 of file buffer 2. The remainder of file buffer 2 
>>> is not truncated.
>>> 
>>> English Conversions
>>> 
>>> The MV syntax supports English conversion of direct or indirect references 
>>> in source operands, provided that the destination is not a select register. 
>>> The format is similar to that used with IBH or IH:
>>> 
>>> reference;input-conversion;
>>> 
>>> reference:output-conversion:
>>> 
>>> For example, MV %3 %3;T1,3; extracts the first three characters of %3 from 
>>> %3 and replaces the original %3 with just these three characters. An 
>>> advantage of using MV to perform conversions (rather than IH or IBH) is 
>>> that MV uses an extensible buffer that is only limited by your OS workspace 
>>> area.
>>> 
>>> See the English Reference Manual for more information on conversions. Note 
>>> that not all conversions are supported by Proc.
>>> 
>>> Example 1
>>> 
>>> Command                   PIB Before                      PIB After
>>> 
>>> MV %4 %2           TEST^ABC^12^         TEST^ABC^12^ABC
>>> 
>>> 
>>> Example 2
>>> 
>>> MV %1 "X",,"9"     AB^CD^EF^GH          X^CD^9^GH
>>> 
>>> 
>>> Example 3
>>> 
>>> MV %5 "X"          ABC                  ABC^^^^X
>>> 
>>> 
>>> Example 4
>>> 
>>> Command                   File Buffer 4 Before          File Buffer 4 After
>>> 
>>> MV &4.1 &2.1,*     000 1494             000 1494
>>>                  001 39100            001 XXX
>>>                  002 AAA              002 7800
>>>                  003 555              003 123
>>>                  004 999             
>>> 
>>>                  File Buffer 2 Before          File Buffer 2 After
>>> 
>>>                  000 1342             000 1342
>>>                  001 XXX              001 XXX
>>>                  002 7800             002 7800
>>>                  003 123              003 123
>>> 
>>> This example moves attributes from file buffer 2 to file buffer 4 using the 
>>> (*) to move the entire contents of file buffer two. Note the truncation of 
>>> the fourth attribute of file buffer 4.
>>> 
>>> Example 5
>>> 
>>> MV %1 "ONE","TWO","THREE"
>>> MV %1 %2,%3
>>> 
>>> The first MV command copies "ONE" into the 1st parameter, "TWO" into the 
>>> 2nd parameter, and "THREE" into the third parameter of the primary input 
>>> buffer.
>>> 
>>> The second MV command copies the contents of the 2nd parameter (TWO) into 
>>> the 1st parameter, and the contents of the 3rd parameter (THREE) into the 
>>> 2nd parameter of the primary input buffer.
>>> 
>>> Example 6
>>> 
>>> Command                   PIB Before and After
>>> 
>>> MV #3 %2           DSPLY^DESC^QTY
>>> 
>>> 
>>>                                POB Before                    POB After
>>> 
>>>                  LIST^INV^            LIST^INV^DESC^
>>> 
>>> 
>>> Example 7
>>> 
>>> Command                   PIB Before and After
>>> 
>>> MV &4.2 %5         UPDATE^CUST^1423^L.NAME^SMITH
>>> 
>>> 
>>>                                File Buffer 4 Before          File Buffer 4 
>>> After
>>> 
>>>                  000 1423             000 1423
>>>                  001 24000            001 24000
>>>                  002 CLARK            002 SMITH
>>>                  003 ROGER            003 ROGER
>>>                  .                    .
>>>                  .                    .
>>>                  .                    .
>>> 
>>> Example 8
>>> 
>>> Command                   PIB Before and After
>>> 
>>> MV &3.1 %3,_       FIX^AB-3211^XYZ
>>> 
>>> 
>>>                                File Buffer 3 Before          File Buffer 3 
>>> After
>>> 
>>>                  000 AB-3211          000 AB-3211
>>>                  001 2353             001 XYZ
>>>                  002 2460
>>> 
>>> _______________________________________________
>>> 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

Reply via email to