External Source Problem

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

External Source Problem

Post by somu_june »

HI,

I'm reading an XML file using External Source stage and my job is aborting by throwing below errors

External_Source_37,0: Source subproc: sh: /Land/XML/Test20100121.xml: cannot execute
.

External_Source_37,0: Filter status 32256;
filter process failed: 126;
import error at record 0.


External_Source_37,0: Import error at record 0.

I selected output properties in External Source file stage as

Source Method : Specific Programs(s)
Source Program = /Land/XML/Test20100121.xml
and in Format tab
I mentioned Record level ........ Final Delimeter = end



Please let me know If I'm doing any thing wrong.


Thanks,
Raju
somaraju
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post by somu_june »

Hi,


The problem is due to I don't have execute permission on the file and the error was gone after I got execute permission. Now my new problem is with the syntax error at line2


xternal_Source_37,0: Source subproc: /Land/XML/Test20100121.xml: syntax error at line 2 : `newline or ;' unexpected
.

External_Source_37,0: Filter status 512;
filter process failed: 2;
import error at record 0.


My first line in XML file is
<?xml version="1.0" encoding="UTF-8"?>

Do I need to change any settings in my Format tab like Record level and Field defaults


Thanks,
Raju
somaraju
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What are you trying to accomplish with the stage? You cannot simply put a file name there, it will treat it as a command or script that it thinks you want to run, hence your 'need' for execute permissions. Hint: you no need. :wink:

If you are trying to emulate examples posted here where the ES stage is used to pass in a full filename to a XML Input stage set to 'URL/Filepath' so it can process it, you need to do just that - pass in the name as a string. Typically you would be doing some form of an "ls" and passing in multiple names, however you could do something like this to pass in a single (known) name:

echo /Land/XML/Test20100121.xml

If you are trying to accomplish something else, please clarify that for us.
-craig

"You can never have too many knives" -- Logan Nine Fingers
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post by somu_june »

Hi Chulett,

I'm trying to read an XML file using External Source file stage.


Thanks,
Raju
somaraju
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sorry but that tells me absolutely nothing. :?

Define 'read' in this context, please. And tell us your complete job design, what's in there besides the troublesome External Source stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post by somu_june »

Hi Chulett,


The job design is External Source-----XMLinputStage------Transformer-----Sequential File Stage. I trying to parse the input XML file and trying to load the data in to a sequential File.




Thanks,
Raju
somaraju
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post by somu_june »

Hi Chulett,

It's my bad. In External source I modified Source Method = Specific Programs and source Program = ls /Land/XML/Test20100121.xml | sort and column as XML_Data longVarchar no length and Nullable to No

In source program I provided the unix commands ls and sort


In format tab I mentioned Record Delimiter as Unix Newline

The job ran sucessfully but I got an warning and no records parsed through XML input stage and I'm getting 1 record from Exrternal Source stage and 0 records from XML input stage . See below warning


Parse_XML,0: Warning: Raj1.Parse_XML: XML input document parsing failed. Reason: Xalan fatal error (publicId: , systemId: , line: 1, column: 1): Invalid document structure



Thanks,
Raju
somaraju
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So, are you trying to do what Ernie laid out here? If so, did you point the XML Input stage to the column coming in from the ES stage and set it to the 'URL/Filepath' option?
-craig

"You can never have too many knives" -- Logan Nine Fingers
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post by somu_june »

Hi Chulett,


Yes exactly I'm trying to do as Ernie mentioned. I will change to URL/File path and run the job. If I'm sucessfull I will let you know.



Thanks,
Raju
somaraju
Post Reply