All: Thank you. For any other professional trainee (best viewed in Courier New font):

The successful integration of the .RGW import specification file looks like this:

GATEWAY IMPORT CUS .v04_fileSpec_importSource +
APPEND stage2_atomized_tt +
OPTION SPECIFICATION_FILE_NAME stage1_list_prepared.rgw

As noted below, the .v04_filespec_importSource variable concatenates the source file with the source path. "Ampersanding" this variable also works.

In the above code, the stage_1_list_prepared.RGW file is found in the same folder as the .RMD file. But what if the .RGW file needs to be stored elsewhere?

SET VAR +
v04_importSpecFilePath = 'D:\WORKBENCH\RBMS\FNAME_2\2-FILE_LIST\', +
v04_importSpecFile = 'stage1_list_prepared.rgw'

SET VAR +
v04_importSpecification = (.v04_importSpecFilePath + .v04_importSpecFile )

GATEWAY IMPORT CUS &v04_fileSpec_importSource +
APPEND stage2_atomized_tt +
OPTION SPECIFICATION_FILE_NAME &v04_importSpecification

Note that the variable v04_importSpecification MUST be ampersanded.

******
Postscript.

The process of defining the .RGW file in the GUI is sensitive to the number of non-null populated columns found in the source-file sample used to capture the column mappings. It is possible that the sample used may not be representative of every row in the real-world data set, e.g. may not contain the maximum number of non-null column values (this is especially possible if one is testing with a small source data set, to avoid hard-resetting one's way out of eternal loops with the real-world data set.)

In my case, the target output table contains fifteen (15) columns; my small source sample contains only eleven (11) non-null columns. The .RGW file - editable with RBEdit, captured the following [Mappings]:

[Mappings]
Count=15
Map0=stage1_filenameID = Field1
Map1=rbms = Field2
Map2=soNum = Field3
Map3=custTextCode = Field4
Map4=docCode = Field5
Map5=docDateRaw = Field6
Map6=docNum = Field7
Map7=docField08 = Field8
Map8=docField09 = Field9
Map9=docField10 = Field10
Map10=docField11 = Field11
Map11=docField12 =
Map12=docField13 =
Map13=stage2_column_count =
Map14=walkListID =

There's the prospect that an attempt to import the real-world data set might fail, should rows contain data in Fields 12 through 15. Simple solution: edit the .RGW file:

...
Map11=docField12 = Field12
Map12=docField13 = Field13
Map13=stage2_column_count = Field14
Map14=walkListID = Field15

The successful tests reported above were performed with both the original and modified .RGW files.

Happy to help, Bruce

Bruce A. Chitiea | SafeSectors, Inc.
112 Harvard Ave #272 | Claremont CA 91711-4716 | USA
+011 (909) 238-9012 m | [email protected]


------ Original Message ------
From "Bruce Chitiea" <[email protected]>
To "[email protected]" <[email protected]>
Date 1/12/2023 9:29:40 AM
Subject Re[4]: [RBASE-L] - GATEWAY IMPORT Fail

Hey Jim, Happy New Year, and thanks. Great minds.

My original code, which I simplified for presentation to the list, looked like this:

  SET VAR  +
    v04_folder_lists = 'D:\WORKBENCH\RBMS\FNAME_2\2-FILE_LIST\', +
    v04_fileList_stage1 = 'stage1_list_prepared.txt'

  SET VAR  +
v04_fileSpec_importSource = (.v04_folder_lists + .v04_fileList_stage1)

  GATEWAY IMPORT CUS &v04_fileSpec_importSource +
    APPEND stage2_atomized_tt +
    OPTION FIRST_ROW 3 +
    |SEPARATOR ( +
    ...+

Also tried the import source as a dot variable. Since the GUI import succeeded, now attempting to integrate the .RGW file into the code.

Always appreciated, Bruce

Bruce A. Chitiea | SafeSectors, Inc.
112 Harvard Ave #272 | Claremont CA 91711-4716 | USA
+011 (909) 238-9012 m | [email protected]



------ Original Message ------
From "'Jim Belisle' via RBASE-L" <[email protected]>
To "[email protected]" <[email protected]>
Date 1/12/2023 9:10:08 AM
Subject RE: Re[2]: [RBASE-L] - GATEWAY IMPORT Fail

The file path set to a var is normally better because you do not have to worry about spaces, etc.

At least that has helped me with my RGW spec code.



James Belisle



Making Information Systems People Friendly Since 1990




From:[email protected] <[email protected]> On Behalf Of Bruce Chitiea
Sent: Thursday, January 12, 2023 11:01 AM
To:[email protected]
Subject: Re[2]: [RBASE-L] - GATEWAY IMPORT Fail



CAUTION:This is an EXTERNAL EMAIL, STOP! and think before clicking on any links or opening attachments.

R:azzak:



Thank you, the GUI import succeeds. An .RGW file was generated during the successful import. I am unclear on the syntax for integrating the .RGW approach into code. This fails to populate the target table:



GATEWAY IMPORT CUS D:\stage1_list_prepared.txt +

APPEND stage2_atomized_tt +

OPTION SPECIFICATION_FILE_NAME stage1_list_prepared.rgw



What have I missed?



Atmospheric River Rafting Regards, Bruce



Bruce A. Chitiea | SafeSectors, Inc.

112 Harvard Ave #272 | Claremont CA 91711-4716 | USA

+011 (909) 238-9012 m | [email protected]



------ Original Message ------

From "A. Razzak Memon" <[email protected]>

To [email protected]

Date 1/11/2023 8:55:32 PM

Subject Re: [RBASE-L] - GATEWAY IMPORT Fail



Bruce,

Are you able to complete the process using the manual GATEWAY IMPORT GUI interface?

If successful, you may create the "Import Specification (.rgw)" file to automate the entire process.

Hope that provides you with some blue's clues!

Very Best R:egards,

Razzak

On 1/11/2023 10:01 PM, Bruce Chitiea wrote:

RBG5XE current



I'll fill in the drywall forehead dents tomorrow, maybe.



Been all over every aspect of this. Exhaustively. Target table refuses to populate.



Can anyone see a reason why this import fails?



GATEWAY TARGET TABLE

  CREATE TEMP TABLE stage2_atomized_tt +

  ( stage1_filenameID TEXT (7) , +

    rbms         TEXT (4) , +

    soNum        TEXT (5) , +

    custCode_txt TEXT (8) , +

    docCode      TEXT (1) , +

    docDateRaw   TEXT (10) , +

    docNum       TEXT (16) , +

    docField08   TEXT (12) , +

    docField09   TEXT (20) , +

    docField10   TEXT (4) , +

    docField11   TEXT (4) , +

    docField12   TEXT (40) , +

    docField13   TEXT (4) , +

    stage2_column_count INT , +

    walkListID   INTEGER )



IMPORT DATA SOURCE (sample set)

  D:\stage1_list_prepared.txt



   stage1_fileName

   -------------------------------------------------------------

   100001(rbms(22650(blkds...(1(2018-11-19(1353(na(0(s(.pdf

   100002(rbms(23233(cpsb....(1(2020-01-29(543199(stock(0(c(.pdf

   100003(rbms(23238(gar.....(1(2020-01-06(7274(na(0(c(.pdf

   100004(rbms(23239(gar.....(1(2020-01-16(7283(na(0(c(.pdf

   100005(rbms(23240(gar.....(1(2020-01-28(7288(na(0(c(.pdf



GATEWAY IMPORT CODE

   GATEWAY IMPORT CUS  D:\stage1_list_prepared.txt +

   APPEND stage2_atomized_tt +

   OPTION FIRST_ROW 3 +

   |SEPARATOR ( +

   |ADD_MAPPING stage1_fileNameID = field1 +

   |ADD_MAPPING rbms         = field2 +

   |ADD_MAPPING soNum        = field3 +

   |ADD_MAPPING custCode_txt = field4 +

   |ADD_MAPPING docCode      = field5 +

   |ADD_MAPPING docDateRaw   = field6 +

   |ADD_MAPPING docNum       = field7 +

   |ADD_MAPPING docField08   = field8 +

   |ADD_MAPPING docField09   = field9 +

   |ADD_MAPPING docField10   = field10 +

   |ADD_MAPPING docField11   = field11 +

   |ADD_MAPPING docField12   = field12 +

   |ADD_MAPPING docField13   = Field13 +

   |ADD_MAPPING stage2_column_count = field14 +

   |ADD_MAPPING walkListID   = field15



I've tried SEPARATOR option value with and without single quotes: [ ( | '(' ]. No difference.



Any thoughts appreciated.



Warmest Regards, Bruce



Bruce A. Chitiea |  SafeSectors, Inc.

112 Harvard Ave #272 | Claremont CA 91711-4716 |  USA

+011 (909) 238-9012 m | [email protected]







--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.rbase.com%2Fsupport%2Fusersgroup_guidelines.php&data=05%7C01%7Cjim%40kaypark.com%7C97bf3237c87e481202ac08daf4be961e%7Cb1d6481668ef495ea1453b4a98d6a532%7C1%7C0%7C638091396669983884%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=gA89acX4EtXwHn3%2Fex%2BwSJEkFJb3UwPButwtP%2BSIWOU%3D&reserved=0>
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/em83b2b1f7-53a0-471e-a941-b9396eee10e5%40fe37ca4e.com <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Frbase-l%2Fem83b2b1f7-53a0-471e-a941-b9396eee10e5%2540fe37ca4e.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cjim%40kaypark.com%7C97bf3237c87e481202ac08daf4be961e%7Cb1d6481668ef495ea1453b4a98d6a532%7C1%7C0%7C638091396670140127%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=dBk6jZJJmhLuJxyI2ZkjYFbpOEKBx%2Br9Gsh86RcLX6c%3D&reserved=0>.



--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.rbase.com%2Fsupport%2Fusersgroup_guidelines.php&data=05%7C01%7Cjim%40kaypark.com%7C97bf3237c87e481202ac08daf4be961e%7Cb1d6481668ef495ea1453b4a98d6a532%7C1%7C0%7C638091396670140127%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=acOMMOK7tl5Q5StLSld8uNKvuCAc0objI3pwKkmNewQ%3D&reserved=0>
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/e13815b8-43c1-be23-f4ea-a4d8bfec3d5b%40rbase.com <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Frbase-l%2Fe13815b8-43c1-be23-f4ea-a4d8bfec3d5b%2540rbase.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cjim%40kaypark.com%7C97bf3237c87e481202ac08daf4be961e%7Cb1d6481668ef495ea1453b4a98d6a532%7C1%7C0%7C638091396670140127%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1aroUN24hNNYQp4nxnVknGEqOA5OXEB4GavZgSYaRCk%3D&reserved=0>.

--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.rbase.com%2Fsupport%2Fusersgroup_guidelines.php&data=05%7C01%7Cjim%40kaypark.com%7C97bf3237c87e481202ac08daf4be961e%7Cb1d6481668ef495ea1453b4a98d6a532%7C1%7C0%7C638091396670140127%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=acOMMOK7tl5Q5StLSld8uNKvuCAc0objI3pwKkmNewQ%3D&reserved=0>
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/emc411f5d5-4fde-4ce4-a2f0-70c63f51c76e%40dfe82e29.com <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Frbase-l%2Femc411f5d5-4fde-4ce4-a2f0-70c63f51c76e%2540dfe82e29.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cjim%40kaypark.com%7C97bf3237c87e481202ac08daf4be961e%7Cb1d6481668ef495ea1453b4a98d6a532%7C1%7C0%7C638091396670140127%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ERRJV%2BEGiI5iaW%2BkW0iuMeuTLakx%2Fq0wOKrvcLYeDdo%3D&reserved=0>.


--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/IA1PR02MB889880A0DCDEB111DE222551A0FD9%40IA1PR02MB8898.namprd02.prod.outlook.com <https://groups.google.com/d/msgid/rbase-l/IA1PR02MB889880A0DCDEB111DE222551A0FD9%40IA1PR02MB8898.namprd02.prod.outlook.com?utm_medium=email&utm_source=footer>.

--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/emc30c9ac2-923d-4653-b8a6-06d739f677b6%40dfe82e29.com <https://groups.google.com/d/msgid/rbase-l/emc30c9ac2-923d-4653-b8a6-06d739f677b6%40dfe82e29.com?utm_medium=email&utm_source=footer>.

--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- You received this message because you are subscribed to the Google Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/em1e7c92e4-e644-43cc-9a64-c0fdfbfaa571%40dfe82e29.com.

Reply via email to