Schema File - Select few columns

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
reachmexyz
Premium Member
Premium Member
Posts: 296
Joined: Sun Nov 16, 2008 7:41 pm

Schema File - Select few columns

Post by reachmexyz »

Hi,

I have a file like

col1, col2, col3,col4
1,2,3,4
2,3,4,5
3,4,5,6

Now i have requirement to load col1, col2,col3 values to one table and col1, col3, col4 to another table.
To acheive this, i have create two schema files, one with col1,col2,col3 and other wiht col1, col3,col4.

When i executed the job individually for two schema files, everytime i am getting all four columns. How can i restrict the job to select only required columns?

How can i perform any transformations like adding col3+col4 when i do not see any metadata in columns definitions?

What is the purpose of intact property and how should i use it?

I appreciate your responses.
mobashshar
Participant
Posts: 91
Joined: Wed Apr 20, 2005 7:59 pm
Location: U.S.

Post by mobashshar »

What have you tries so far?
Try using copy stage and see how it goes.
reachmexyz
Premium Member
Premium Member
Posts: 296
Joined: Sun Nov 16, 2008 7:41 pm

Post by reachmexyz »

I have close to 40 different layouts to load 40 different tables. This is the reason why i have picked schema files instead of canvassing 40 sequential file stages.
eph
Premium Member
Premium Member
Posts: 110
Joined: Mon Oct 18, 2010 10:25 am

Post by eph »

Hi,

You can use 'drop' in your schema file at column level:

Code: Select all

record
  {final_delim=none, record_delim_string='~~~~', delim=none, charset='UTF8'}
(
  BUSINESS_UNIT:ustring[max=5] {drop};
  JOURNAL_ID:ustring[max=10];
  JOURNAL_DATE:timestamp;
  IU_ANCHOR_FLG:ustring[max=1];
)
Eric
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

reachmexyz wrote:I have close to 40 different layouts to load 40 different tables. This is the reason why i have picked schema files instead of canvassing 40 sequential file stages.
Schema files and one RCP enabled job, yes?

All fields must always be read from a sequential file, that's their nature. Eric's "drop" sounds like the ticket when you only need to process a subset of the fields. However...
reachmexyz also wrote:How can i perform any transformations like adding col3+col4 when i do not see any metadata in columns definitions?
With RCP in control of the columns, you cannot.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply