Re: [U2] UniData PreStore to change the KEY of a record?

2013-05-29 Thread Mecki Foerthmann
To stay with the picture of not using a hammer to drive in a screw, I would just write a Basic program to do this. Use the right tool for the job! Open the file Execute GET-LIST Then a loop that generates the new Ids including checking that it doesn't already exist, READU record from old Id,

Re: [U2] UniData PreStore to change the KEY of a record?

2013-05-29 Thread Martin Braid
Quite. Less lines than the original post. - Epicor Software (UK) is a limited company registered in England Wales. Registration Number: 2338274. Registered Office: 6th Floor, One London Wall, London EC2Y 5EB This e-mail and any attachments to it are confidential

Re: [U2] UniData PreStore to change the KEY of a record?

2013-05-29 Thread Charlie Noah
Another excellent suggestion, Mecki, especially if one isn't familiar with paragraphs. I tend to use them a lot for one-offs because I've used them a lot over the years, and am very comfortable with them, but a Basic program would be just as easy. More than once I've built a paragraph to do a

Re: [U2] UniData PreStore to change the KEY of a record?

2013-05-29 Thread David Wolverton
OK - a program was always a choice -- just wanted to ensure I had not missed a 'simple feature' of AE along the way -- again - 90 records -- I have to alter a single attribute and change the key ... was hoping I could do one 'compound' prestore! No such luck! Thanks all... at least I know I have

Re: [U2] UniData PreStore to change the KEY of a record?

2013-05-29 Thread Bill Haskett
Or, you could download the BPTEST or TRY program from: http://www.pickwiki.com/cgi-bin/wiki.pl?BasicSource ...then write the simple code from the command line. Not only are these programs good to test syntax, but they're great for performing simple tasks that don't work from the command

Re: [U2] UniData PreStore to change the KEY of a record?

2013-05-28 Thread Colin Alfke
Sure, you should be able to write the record with the new key and then delete the existing record. The trouble comes in making sure another record doesn't already exist with the new key. Hth Colin -Original Message- From: David Wolverton Sent: Tuesday, May 28, 2013 11:48 AM To: 'U2

Re: [U2] UniData PreStore to change the KEY of a record?

2013-05-28 Thread David Wolverton
But how would I 'swap out' the bad piece? For example - -the key is currently bad.1234 and I want it to be good.1234 How would I perform that 'replace' on the ID for the record? -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org]

Re: [U2] UniData PreStore to change the KEY of a record?

2013-05-28 Thread Daniel McGrath
You can't 'swap'. What you can do is save it as a new name and delete the old record. If you are doing this on a live system as part of production support (hopefully development isn't been done there), make sure you understand how code is using that file and lock as appropriate, otherwise you

Re: [U2] UniData PreStore to change the KEY of a record?

2013-05-28 Thread Wjhonson
I do not think you can Prestore a replacement command to operate on the KEY (attribute zero) I would suggest giving the task to an expert user and teaching said user how to look at the Key, mentally replace bad with good and then SAVE GOOD1234, followed by FD -Original

Re: [U2] UniData PreStore to change the KEY of a record?

2013-05-28 Thread bradley . schrag
And if you go that route, I have used Excel a number of times for this type of thing. I use formulas to replicate what a user would type and then paste into either TCL or ED. It takes a little time to work out the details, but once you have it, you can reuse pretty easily. As someone noted

Re: [U2] UniData PreStore to change the KEY of a record?

2013-05-28 Thread Israel, John R.
There is also the danger in a PreStore where you go to field 30 to make your change, but the record(s) in question does not have that many field. It instead goes to the last field and execute the change. This can be disastrous! Be careful! JRI -Original Message- From:

Re: [U2] UniData PreStore to change the KEY of a record?

2013-05-28 Thread Wols Lists
On 28/05/13 20:05, Daniel McGrath wrote: You can't 'swap'. What you can do is save it as a new name and delete the old record. If you are doing this on a live system as part of production support (hopefully development isn't been done there), make sure you understand how code is using

Re: [U2] UniData PreStore to change the KEY of a record?

2013-05-28 Thread David A. Green
I would take my saved list and copy it to a text editor then using copy commands and a quick macro convert the list into a bunch of COPY FROM FILE.A BAD.KEY, GOOD.KEY commands. Then save it as a PA and then execute it. David A. Green (480) 813-1725 DAG Consulting -Original Message-

Re: [U2] UniData PreStore to change the KEY of a record?

2013-05-28 Thread Charlie Noah
Dang, David, you beat me to it. ;^) I was just going to suggest the same thing. Just because the OP wanted to use ED (a hammer) to drive in a screw doesn't mean that it is the best tool ( a screwdriver). Good answer. Charlie Noah On 05-28-2013 3:42 PM, David A. Green wrote: I would take my