Excerpt from page 1-161 of the "UniQuery Commands Reference" available
at

http://www.rocketsoftware.com/u2/products/unidata/resources/manuals/unid
ata-7.3-documentation/uniquery-commands-reference/view

REFORMAT
Syntax
REFORMAT filename attributes [selection_criteria]
Description
The UniQuery REFORMAT command copies record attributes you specify from
one data file to another data file. The destination file must already
exist. REFORMAT uses the first attribute named in the UniQuery statement
as the record ID in the destination file. The remaining attributes in
the UniQuery statement become record attributes in the destination file.
UniQuery prompts for the name of the destination file after you enter
the REFORMAT command.

Sincerely,
David Laansma

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Wjhonson
Sent: Monday, September 10, 2012 4:02 PM
To: [email protected]
Subject: Re: [U2] Inverting/Pivoting a table


 EXECUTE "REFORMAT"
it doesn't copy, it changes the format as well in other words, it
pivots, as you asked

 

 

-----Original Message-----
From: Dave Laansma <[email protected]>
To: U2 Users List <[email protected]>
Sent: Mon, Sep 10, 2012 12:59 pm
Subject: Re: [U2] Inverting/Pivoting a table


REFORMAT appears to be a UniQuery command and appears to be used to copy
records from one file to another.

I'm looking for this type of functionality in a UniBasic program.

Sincerely,
David Laansma

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Robert Houben
Sent: Monday, September 10, 2012 3:41 PM
To: U2 Users List
Subject: Re: [U2] Inverting/Pivoting a table

REFORMAT is a TCL command.

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Dave Laansma
Sent: September-10-12 12:39 PM
To: U2 Users List
Subject: Re: [U2] Inverting/Pivoting a table

REFORMAT perhaps?

I am find no reference to a Unibasic command/statement REFORMAT.

Sincerely,
David Laansma
IT Manager
Hubbard Supply Co.
Direct: 810-342-7143
Office: 810-234-8681
Fax: 810-234-6142
www.hubbardsupply.com
"Delivering Products, Services and Innovative Solutions"


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Wjhonson
Sent: Monday, September 10, 2012 2:20 PM
To: [email protected]
Subject: Re: [U2] Inverting/Pivoting a table


REFOMAT



-----Original Message-----
From: Wols Lists <[email protected]>
To: u2-users <[email protected]>
Sent: Mon, Sep 10, 2012 11:07 am
Subject: Re: [U2] Inverting/Pivoting a table


On 10/09/12 14:39, Dave Laansma wrote:
> I get flat files that I'd like to 'flip' to accommodate the 
> multi-value database. For example, given this table:
>
I thought there was a command that would flip a FILE like that. I've
never used it, but I recall a colleague making good use of it ...
>
> 123456<vm>DAVID JONES<vm>1234 MAIN ST.<vm>ANYWHERE<vm>MI<vm>12345<am>
>
> 654321<vm>JOHN SMITH<vm>4321 MAIN ST.<vm>ANYWHERE<vm>MI<vm>12345
>
>
>
> Is there a function that will change it to:
>
>
>
> 123456<vm>654321<am>
>
> DAVID JONES<vm>JOHN SMITH<am>
>
> 1234 MAIN ST.<vm>4321 MAIN ST.<am>
>
> ANYWHERE<vm>ANYWHERE<am>
>
> MI<vm>MI<am>
>
> 12345<vm>12345
>
>
>
> Right now I use these nested loops, which tend to take a while 
> depending on the size of TABLE:
>
And here you're using dynamic arrays. If you're in PI syntax, do a
DCOUNT to get the number of people, dimension some static arrays, and
dump the data into that. It'll be MUCH faster. You can REMOVE the
elements from the original dynamic array (fast), dump them into your
static array(s) (fast), and MATBUILD your new array (fast).
>
>
> NEW.TABLE = ""
>
>
>
> FOR A1 = 1 TO DCOUNT(TABLE,@AM)
>
>   FOR V1 = 1 TO DCOUNT(TABLE<A1>,@VM)
>
>     NEW.TABLE<V1,A1> = TABLE<A1,V1>
>
>   NEXT V1
>
> NEXT A1
>
>
>
> TABLE = NEW.TABLE
>
>
>
> Sincerely,
>
> David Laansma
>
Cheers,
Wol
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users


_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

 
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to