adding a single record from command line
John Esak
john at valar.com
Mon Oct 25 15:51:56 PDT 2010
I haven't looked "ahead" at any other responses... . Just too easy to throw
out a quick response that will help even others have said the same thing
already.
Just - in your import process - put a couple lines in @once processing - Do
a lookup to record 1 r=("1") and if it is there just END all is well. Your
import will procede. If there is no record 1 then do a lookup free to the
file you are in (just use the file's own name) and then a line that says
lookup - to that record number, then END and your import stuff should move
on from there.
@once if:
then: lookup there=this_filename r=("1")
if: there
then: END
if:
then: lookup recone=(this_filename r=free
then: WRITE recone
then: lookup - r=(recone("1")
then: END
At this point your regular -z processing will begin at the top of the prc
table.
I don't do IMPORTS at all this way... And I don't want to think about how
you keep adding records from here.... Do you use a -xa on the commanhd line
or something. That's up to you.
Maybe you are running your IMPORT to a looked-up file... Kind of the way I
do it... But I don't need to do the get record one stuff, becausse in my
IMPORT process I do the "ddir filename -k" in the @once process instead of
the get record one thing. Now, all I do is lookup free's to that nice clean
file for each record in the .csv or whatever type file I'm importaing.
HTH
John
> -----Original Message-----
> From: filepro-list-bounces+john=valar.com at lists.celestial.com
> [mailto:filepro-list-bounces+john=valar.com at lists.celestial.co
m] On Behalf Of scooter6 at gmail.com
> Sent: Monday, October 25, 2010 10:21 AM
> To: filePro Mailing List
> Subject: adding a single record from command line
>
> I have a 'temp' file that I import from a client, then do
> misc processing on
> it and then copy all these records to a duplicate file for
> archive purposes.
> I delete them from the original 'temp' file after I copy them
> to the archive
> file.
>
> Since the only time I get records to add to this 'temp' file
> are in the form
> of a file I receive from a client, I run -K to delete all the 'blank'
> records to keep this 'temp' file
> from growing with a bunch of 'empty' records, etc.
> As you know, there must be at least 1 record in a filePro
> file in order to
> do an 'import' to it.....so is there a built in command to
> add one record to
> a file that has no records in it currently?
>
> I guess I could write a simple output processing to do this
> for me, just
> didn't know if there was a command I was unfamiliar with to
> simply add 1
> blank record to a file
>
>
> Thanks
>
> Scott
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.celestial.com/pipermail/filepro-list/attachment
s/20101025/c6d9bf2a/attachment.html
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
More information about the Filepro-list
mailing list