Archives of the TeradataForum
Message Posted: Fri, 27 Dec 2002 @ 20:00:27 GMT
I need some feedback from the INMOD experts on the list. I did not see any answers in the archive and I just know we are brimming with experts on this list. I have been trying to use an INMOD routine in various fashions to work with MLOAD. It seems that I can only use fixed text format as the input. Any time I try to use VARCHAR, it exits with an error about the first field (like it did not end correctly after the first transaction). I started with the routines in the documentation but there is nothing in the documentation to correspond to using that example INMOD in a Multiload.
For instance, the following does NOT work: .LAYOUT INPUTLAYOUT; .FIELD IN_DUMMY * VARCHAR(3) ; .FIELD IN_GroupingID * VARCHAR(5) ; .FIELD IN_GroupingName * VARCHAR(100) ; .DML LABEL PGMINMOD IGNORE DUPLICATE INSERT ROWS; INSERT INTO SSA.PGMINMOD( GroupingID ,GroupingName ) VALUES ( :IN_GroupingID ,:IN_GroupingName ); .IMPORT INMOD mlimodf using ( ..\\data\\source\\something.dat ) Format VARTEXT '|' LAYOUT INPUTLAYOUT APPLY PGMINMOD; I get the following error: **** 14:18:15 UTY0817 MultiLoad submitting the following request: BEGIN TRANSACTION; **** 14:18:15 UTY0817 MultiLoad submitting the following request: CHECKPOINT LOADING; **** 14:18:16 UTY4203 Attempted to access out of range input data in field 'IN_DUMMY', file '',record number '1'. **** 14:18:16 UTY1803 Import processing statistics . IMPORT 1 Total thus far --------------------------------------------------------- Candidate records considered:........ 1....... 1 Apply conditions satisfied:.......... 0....... 0 Candidate records not applied:....... 0....... 0 Candidate records rejected:.......... 0....... 0 The following is the vartext data: Y|1|Beer & Wine Sales $ N|2|Beer & Wine Margin % y|3|Cigarette Sales $ y|4|Cigarette Margin % y|5|Hot Beverage Sales $ However if I change the data file to fixed format: .LAYOUT INPUTLAYOUT; .FIELD IN_DUMMY * CHAR(3) ; .FIELD IN_GroupingID * CHAR(5) ; .FIELD IN_GroupingName * CHAR(100) ; .DML LABEL PGMINMOD IGNORE DUPLICATE INSERT ROWS; INSERT INTO SSA.PGMINMOD( GroupingID ,GroupingName ) VALUES ( :IN_GroupingID ,:IN_GroupingName ); .IMPORT INMOD mlimodf using ( '..\\data\\source\\test.dat' ) Format TEXT LAYOUT INPUTLAYOUT APPLY PGMINMOD; This works. Same data (except expanded with blanks). For example: Y 1Beer & Wine Sales $ N 2Beer & Wine Margin % y 3Cigarette Sales $ y 4Cigarette Margin % y 5Hot Beverage Sales $
Can anyone tell me why this is. Also, I can't seem to pass a variable filename into the program. I always get an error (c program) when executing the open command. I have tried enclosing with single quotes, double quotes, nothing. I have tried all of those with double back slashes \ and with a single back slash in the filename. Doesn't seem to matter.
I would be very grateful for any feedback!!! We want to use vartext as our input in the future (with inmod's).
|Copyright 2016 - All Rights Reserved|
|Last Modified: 27 Dec 2016|