On 11/05/12 17:36, Wjhonson wrote:
> 
> I thought that too.
> Tried that one.
> What it actually does is store all the trailing attributes in the "header" 
> and then append them back to the record when it writes it out.
> Universe 10.3
> 
What flavour? That ALWAYS worked for me on PI.

Let's say your dict declares up to, say, field 20 and you know there
*shouldn't* be anything beyond it.

Sounds actually, like you are in PI mode so ...
Declare your MAT as 20 long :-)
Add a line before the write which says

IF CONVERT( REC(0), @FM:" ", "") EQ "" THEN REC(0) = "" ELSE PRINT
"Record ":ID:" contains extra data!"

So basically, you're dumping what you don't want into element 0. The
convert checks that it really is nothing before zeroing it.

I'm guessing it's not working for you because somehow there are actually
spaces in those fields you think are blank (ED gets rid of trailing
spaces ...)

You can pull the same stunt for PICK mode, just remember the extra
entries will end up in the last element of the array.

Cheers,
Wol

> 
> 
> 
> -----Original Message-----
> From: andy baum <andyb...@yahoo.co.uk>
> To: U2 Users List <u2-users@listserver.u2ug.org>
> Sent: Fri, May 11, 2012 6:30 am
> Subject: Re: [U2] Trim trailing attributes off records
> 
> 
> How about :-
> OPEN 'FILENAME' TO FILEVAR ELSE
>    STOPM 'Cannot open FILENAME'
> END
> 
> IM REC(500)
> 
> ELECT FILEVAR
> LOOP
> WHILE READNEXT ID
>    MATREADU REC FROM FILEVAR,ID THEN
>       MATWRITE REC TO FILEVAR,ID
>    END
> REPEAT
> 
> ND
> 
> ATWRITE trims trailing blank attributes as it writes the data away
> 
> heers,
> Andy
> 
> 
> From: Wjhonson <wjhon...@aol.com>
> o: u2-users@listserver.u2ug.org 
> ent: Thursday, 10 May 2012, 23:13
> ubject: [U2]  Trim trailing attributes off records
> 
> 
> iven that you have a file with thousands of records, each with dozens of 
> railing attributes which are empty.
> How can you pick up the file and drop it back down with all those empties 
> rimmed off?
> __
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to