Re: [U2] UniData PreStore to change the KEY of a record?
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, WRITE record to new ID, DELETE old record. A few lines of code written in less than a minute. Compile, generate list, run program, job done! On 28/05/2013 21:59, Charlie Noah wrote: 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 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- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of David Wolverton Sent: Tuesday, May 28, 2013 10:48 AM To: 'U2 Users List' Subject: [U2] UniData PreStore to change the KEY of a record? I am always using what I call 'PreStore' command... In the AE editor, I need to change Attb 2 from A]thisbad]C]D to be A]thisgood]C]D on a list of items... So I get the list, AE FILENAME and then... =FIX 2`R/thisbad/thisgood/`FI`=FIX Viola! The data is updated. I have a need to 'fix' a KEY to a record... Is there a way to use a PreStore command that could do that? It's 95 records. Too many to hand edit. Too few to write a program. A PreStore would be JUST RIGHT... if there was a way to do it! DW ___ 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] UniData PreStore to change the KEY of a record?
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 and is for the use of the intended recipient(s) only. If you have received this e-mail in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not use, disclose or distribute this e-mail without the author's prior permission. We have taken precautions to minimize the risk of transmitting software viruses, but we advise you to carry out your own virus checks on any attachment to this message. We cannot accept liability for any loss or damage caused by software viruses. Any views and/or opinions expressed in this e-mail are of the author only and do not represent the views of Epicor Software (UK) Limited or any other company within its group. - -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Mecki Foerthmann Sent: 29 May 2013 08:25 To: U2 Users List Subject: Re: [U2] UniData PreStore to change the KEY of a record? 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, WRITE record to new ID, DELETE old record. A few lines of code written in less than a minute. Compile, generate list, run program, job done! On 28/05/2013 21:59, Charlie Noah wrote: 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 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- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of David Wolverton Sent: Tuesday, May 28, 2013 10:48 AM To: 'U2 Users List' Subject: [U2] UniData PreStore to change the KEY of a record? I am always using what I call 'PreStore' command... In the AE editor, I need to change Attb 2 from A]thisbad]C]D to be A]thisgood]C]D on a list of items... So I get the list, AE FILENAME and then... =FIX 2`R/thisbad/thisgood/`FI`=FIX Viola! The data is updated. I have a need to 'fix' a KEY to a record... Is there a way to use a PreStore command that could do that? It's 95 records. Too many to hand edit. Too few to write a program. A PreStore would be JUST RIGHT... if there was a way to do it! DW ___ 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 Click https://www.mailcontrol.com/sr/MZbqvYs5QwJvpeaetUwhCQ== to report this email as spam. This message has been scanned for malware by Websense. www.websense.com ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] UniData PreStore to change the KEY of a record?
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 job for a user, only to have them scope creep me into writing a program anyway. Charlie On 05-29-2013 2:25 AM, Mecki Foerthmann wrote: 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, WRITE record to new ID, DELETE old record. A few lines of code written in less than a minute. Compile, generate list, run program, job done! On 28/05/2013 21:59, Charlie Noah wrote: 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 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- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of David Wolverton Sent: Tuesday, May 28, 2013 10:48 AM To: 'U2 Users List' Subject: [U2] UniData PreStore to change the KEY of a record? I am always using what I call 'PreStore' command... In the AE editor, I need to change Attb 2 from A]thisbad]C]D to be A]thisgood]C]D on a list of items... So I get the list, AE FILENAME and then... =FIX 2`R/thisbad/thisgood/`FI`=FIX Viola! The data is updated. I have a need to 'fix' a KEY to a record... Is there a way to use a PreStore command that could do that? It's 95 records. Too many to hand edit. Too few to write a program. A PreStore would be JUST RIGHT... if there was a way to do it! DW ___ 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] UniData PreStore to change the KEY of a record?
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 'maxed out' the usage of PreStores!! DW -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Mecki Foerthmann Sent: Wednesday, May 29, 2013 2:25 AM To: U2 Users List Subject: Re: [U2] UniData PreStore to change the KEY of a record? 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, WRITE record to new ID, DELETE old record. A few lines of code written in less than a minute. Compile, generate list, run program, job done! On 28/05/2013 21:59, Charlie Noah wrote: 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 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- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of David Wolverton Sent: Tuesday, May 28, 2013 10:48 AM To: 'U2 Users List' Subject: [U2] UniData PreStore to change the KEY of a record? I am always using what I call 'PreStore' command... In the AE editor, I need to change Attb 2 from A]thisbad]C]D to be A]thisgood]C]D on a list of items... So I get the list, AE FILENAME and then... =FIX 2`R/thisbad/thisgood/`FI`=FIX Viola! The data is updated. I have a need to 'fix' a KEY to a record... Is there a way to use a PreStore command that could do that? It's 95 records. Too many to hand edit. Too few to write a program. A PreStore would be JUST RIGHT... if there was a way to do it! DW ___ 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] UniData PreStore to change the KEY of a record?
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 line. Bill - Original Message - *From:* mec...@gmx.net *To:* U2 Users List u2-users@listserver.u2ug.org *Date:* 5/29/2013 12:25 AM *Subject:* Re: [U2] UniData PreStore to change the KEY of a record? 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, WRITE record to new ID, DELETE old record. A few lines of code written in less than a minute. Compile, generate list, run program, job done! On 28/05/2013 21:59, Charlie Noah wrote: 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 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- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of David Wolverton Sent: Tuesday, May 28, 2013 10:48 AM To: 'U2 Users List' Subject: [U2] UniData PreStore to change the KEY of a record? I am always using what I call 'PreStore' command... In the AE editor, I need to change Attb 2 from A]thisbad]C]D to be A]thisgood]C]D on a list of items... So I get the list, AE FILENAME and then... =FIX 2`R/thisbad/thisgood/`FI`=FIX Viola! The data is updated. I have a need to 'fix' a KEY to a record... Is there a way to use a PreStore command that could do that? It's 95 records. Too many to hand edit. Too few to write a program. A PreStore would be JUST RIGHT... if there was a way to do it! DW ___ 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] UniData PreStore to change the KEY of a record?
I am always using what I call 'PreStore' command... In the AE editor, I need to change Attb 2 from A]thisbad]C]D to be A]thisgood]C]D on a list of items... So I get the list, AE FILENAME and then... =FIX 2`R/thisbad/thisgood/`FI`=FIX Viola! The data is updated. I have a need to 'fix' a KEY to a record... Is there a way to use a PreStore command that could do that? It's 95 records. Too many to hand edit. Too few to write a program. A PreStore would be JUST RIGHT... if there was a way to do it! DW ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] UniData PreStore to change the KEY of a record?
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 Users List' Subject: [U2] UniData PreStore to change the KEY of a record? I am always using what I call 'PreStore' command... In the AE editor, I need to change Attb 2 from A]thisbad]C]D to be A]thisgood]C]D on a list of items... So I get the list, AE FILENAME and then... =FIX 2`R/thisbad/thisgood/`FI`=FIX Viola! The data is updated. I have a need to 'fix' a KEY to a record... Is there a way to use a PreStore command that could do that? It's 95 records. Too many to hand edit. Too few to write a program. A PreStore would be JUST RIGHT... if there was a way to do it! DW ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] UniData PreStore to change the KEY of a record?
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] On Behalf Of Colin Alfke Sent: Tuesday, May 28, 2013 1:04 PM To: 'U2 Users List' Subject: Re: [U2] UniData PreStore to change the KEY of a record? 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 Users List' Subject: [U2] UniData PreStore to change the KEY of a record? I am always using what I call 'PreStore' command... In the AE editor, I need to change Attb 2 from A]thisbad]C]D to be A]thisgood]C]D on a list of items... So I get the list, AE FILENAME and then... =FIX 2`R/thisbad/thisgood/`FI`=FIX Viola! The data is updated. I have a need to 'fix' a KEY to a record... Is there a way to use a PreStore command that could do that? It's 95 records. Too many to hand edit. Too few to write a program. A PreStore would be JUST RIGHT... if there was a way to do it! DW ___ 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] UniData PreStore to change the KEY of a record?
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 might have it double process the same record under different names. This probably isn't something you can do as a regular PreStore. Regards, Dan McGrath Managing Director, U2 Servers Lab Rocket Software -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of David Wolverton Sent: Tuesday, May 28, 2013 12:11 PM To: 'U2 Users List' Subject: Re: [U2] UniData PreStore to change the KEY of a record? 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] On Behalf Of Colin Alfke Sent: Tuesday, May 28, 2013 1:04 PM To: 'U2 Users List' Subject: Re: [U2] UniData PreStore to change the KEY of a record? 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 Users List' Subject: [U2] UniData PreStore to change the KEY of a record? I am always using what I call 'PreStore' command... In the AE editor, I need to change Attb 2 from A]thisbad]C]D to be A]thisgood]C]D on a list of items... So I get the list, AE FILENAME and then... =FIX 2`R/thisbad/thisgood/`FI`=FIX Viola! The data is updated. I have a need to 'fix' a KEY to a record... Is there a way to use a PreStore command that could do that? It's 95 records. Too many to hand edit. Too few to write a program. A PreStore would be JUST RIGHT... if there was a way to do it! DW ___ 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] UniData PreStore to change the KEY of a record?
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 Message- From: David Wolverton dwolv...@flash.net To: 'U2 Users List' u2-users@listserver.u2ug.org Sent: Tue, May 28, 2013 10:48 am Subject: [U2] UniData PreStore to change the KEY of a record? I am always using what I call 'PreStore' command... In the AE editor, I need to change Attb 2 from A]thisbad]C]D to be A]thisgood]C]D on a list of items... So I get the list, AE FILENAME and then... =FIX 2`R/thisbad/thisgood/`FI`=FIX Viola! The data is updated. I have a need to 'fix' a KEY to a record... Is there a way to use a PreStore command that could do that? It's 95 records. Too many to hand edit. Too few to write a program. A PreStore would be JUST RIGHT... if there was a way to do it! DW ___ 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] UniData PreStore to change the KEY of a record?
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 earlier, the rub comes in ensuring you don't overwrite an existing record. Assuming you've done that, this might get you started. Bad Good Command A B ED FILE A SV B FD Y Where command is this Excel formula: =ED FILE A2CHAR(10)SV B2CHAR(10) FDCHAR(10)YCHAR(10) Depending on which version of Excel you have, it may include the leading when you paste. If so, paste into Notepad or Word and remove the leading HTH, Brad. From: Wjhonson wjhon...@aol.com To: u2-users@listserver.u2ug.org, Date: 05/28/2013 02:42 PM Subject:Re: [U2] UniData PreStore to change the KEY of a record? Sent by:u2-users-boun...@listserver.u2ug.org 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 Message- From: David Wolverton dwolv...@flash.net To: 'U2 Users List' u2-users@listserver.u2ug.org Sent: Tue, May 28, 2013 10:48 am Subject: [U2] UniData PreStore to change the KEY of a record? I am always using what I call 'PreStore' command... In the AE editor, I need to change Attb 2 from A]thisbad]C]D to be A]thisgood]C]D on a list of items... So I get the list, AE FILENAME and then... =FIX 2`R/thisbad/thisgood/`FI`=FIX Viola! The data is updated. I have a need to 'fix' a KEY to a record... Is there a way to use a PreStore command that could do that? It's 95 records. Too many to hand edit. Too few to write a program. A PreStore would be JUST RIGHT... if there was a way to do it! DW ___ 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 U.S. BANCORP made the following annotations - Electronic Privacy Notice. This e-mail, and any attachments, contains information that is, or may be, covered by electronic communications privacy laws, and is also confidential and proprietary in nature. If you are not the intended recipient, please be advised that you are legally prohibited from retaining, using, copying, distributing, or otherwise disclosing this information in any manner. Instead, please reply to the sender that you have received this communication in error, and then immediately delete it. Thank you in advance for your cooperation. - ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] UniData PreStore to change the KEY of a record?
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: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of bradley.sch...@usbank.com Sent: Tuesday, May 28, 2013 3:54 PM To: U2 Users List Subject: Re: [U2] UniData PreStore to change the KEY of a record? 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 earlier, the rub comes in ensuring you don't overwrite an existing record. Assuming you've done that, this might get you started. Bad Good Command A B ED FILE A SV B FD Y Where command is this Excel formula: =ED FILE A2CHAR(10)SV B2CHAR(10) FDCHAR(10)YCHAR(10) Depending on which version of Excel you have, it may include the leading when you paste. If so, paste into Notepad or Word and remove the leading HTH, Brad. From: Wjhonson wjhon...@aol.com To: u2-users@listserver.u2ug.org, Date: 05/28/2013 02:42 PM Subject:Re: [U2] UniData PreStore to change the KEY of a record? Sent by:u2-users-boun...@listserver.u2ug.org 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 Message- From: David Wolverton dwolv...@flash.net To: 'U2 Users List' u2-users@listserver.u2ug.org Sent: Tue, May 28, 2013 10:48 am Subject: [U2] UniData PreStore to change the KEY of a record? I am always using what I call 'PreStore' command... In the AE editor, I need to change Attb 2 from A]thisbad]C]D to be A]thisgood]C]D on a list of items... So I get the list, AE FILENAME and then... =FIX 2`R/thisbad/thisgood/`FI`=FIX Viola! The data is updated. I have a need to 'fix' a KEY to a record... Is there a way to use a PreStore command that could do that? It's 95 records. Too many to hand edit. Too few to write a program. A PreStore would be JUST RIGHT... if there was a way to do it! DW ___ 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 U.S. BANCORP made the following annotations - Electronic Privacy Notice. This e-mail, and any attachments, contains information that is, or may be, covered by electronic communications privacy laws, and is also confidential and proprietary in nature. If you are not the intended recipient, please be advised that you are legally prohibited from retaining, using, copying, distributing, or otherwise disclosing this information in any manner. Instead, please reply to the sender that you have received this communication in error, and then immediately delete it. Thank you in advance for your cooperation. - ___ 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] UniData PreStore to change the KEY of a record?
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 that file and lock as appropriate, otherwise you might have it double process the same record under different names. This probably isn't something you can do as a regular PreStore. Dunno if it would actually work, or quite how you would do it, but my immediate reaction was ED :-) and a saved command there. You can put loops in, so you select the file, do an ED *, SAVE newname, FD. The problem I can see is how to programatically create newname to save it. Maybe you need to go back to something old-fashioned like PROC! (gasp, shock, horror). Regards, Dan McGrath Managing Director, U2 Servers Lab Rocket Software Cheers, Wol ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] UniData PreStore to change the KEY of a record?
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- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of David Wolverton Sent: Tuesday, May 28, 2013 10:48 AM To: 'U2 Users List' Subject: [U2] UniData PreStore to change the KEY of a record? I am always using what I call 'PreStore' command... In the AE editor, I need to change Attb 2 from A]thisbad]C]D to be A]thisgood]C]D on a list of items... So I get the list, AE FILENAME and then... =FIX 2`R/thisbad/thisgood/`FI`=FIX Viola! The data is updated. I have a need to 'fix' a KEY to a record... Is there a way to use a PreStore command that could do that? It's 95 records. Too many to hand edit. Too few to write a program. A PreStore would be JUST RIGHT... if there was a way to do it! DW ___ 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] UniData PreStore to change the KEY of a record?
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 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- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of David Wolverton Sent: Tuesday, May 28, 2013 10:48 AM To: 'U2 Users List' Subject: [U2] UniData PreStore to change the KEY of a record? I am always using what I call 'PreStore' command... In the AE editor, I need to change Attb 2 from A]thisbad]C]D to be A]thisgood]C]D on a list of items... So I get the list, AE FILENAME and then... =FIX 2`R/thisbad/thisgood/`FI`=FIX Viola! The data is updated. I have a need to 'fix' a KEY to a record... Is there a way to use a PreStore command that could do that? It's 95 records. Too many to hand edit. Too few to write a program. A PreStore would be JUST RIGHT... if there was a way to do it! DW ___ 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