Field(Orders.RecIn,"","",2) = RecType

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
samsuf2002
Premium Member
Premium Member
Posts: 397
Joined: Wed Apr 12, 2006 2:28 pm
Location: Tennesse

Post by samsuf2002 »

this is due to low memory adding an environment variable

add APT_DISABLE_COMBINATION and set it as true might help try it
hi sam here
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The Field() function only has 3 parameters, the string, the delimiter and the occurrence number.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The Field() function may have three or four arguments, Arnd. The fourth is number of fields to return.

However, I do not believe that the third argument for Field() can legally be a string; it must be an integer. Therefore, assuming that you've read the entire source record (RecIn) as a VarChar and want to return the second comma-delimited field from it, the correct specification is

Code: Select all

Field(InLink.RecIn, ",", 2, 1) 
or more simply

Code: Select all

Field(InLink.RecIn, ",", 2)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
venkat_kp
Charter Member
Charter Member
Posts: 33
Joined: Sun May 07, 2006 8:16 am

Did not work

Post by venkat_kp »

Thank you all for the info. But still the result is the same

Yes read the entire source record (RecIn) as a VarChar and want to return the A, second comma-delimited field from it.

When Field(InLink.RecIn, ",", 2, 1) is used it's pulling only
"
"
"
"
"
"
and with Field(InLink.RecIn, ",", 2) job is getting aborted with
the previous messages.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You need to reduce the string so that it can fit into Char(1). Since you're reading the entire line as a single string, the Field() function is returning the quote characters as well as the quoted value. Therefore you also need to Trim() the quote characters from the result of the Field() function.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

And what is stopping you to read as comma delimited with double quote
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The fact (already stated) that the entire record has been read as a single string, presumably because the file contains more than one record type. Note the name of the field that is being attempted to be extracted.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

ray.wurlod wrote:The Field() function may have three or four arguments, Arnd. The fourth is number of fields to return.
I shouldn't have tried that without having a BASIC to check; for some reason I thought that PX didn't allow the 4th arg. But the arguments were incorrectly ordered as well in the OP.
venkat_kp
Charter Member
Charter Member
Posts: 33
Joined: Sun May 07, 2006 8:16 am

After removing the quotes in the source it worked

Post by venkat_kp »

After removing the quotes in the source and retyping the derivation (Field(InLink.RecIn, ",", 2) it worked.

Thank you all.
Post Reply