datasource is notepad

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
knowledge
Participant
Posts: 101
Joined: Mon Oct 17, 2005 8:14 am

datasource is notepad

Post by knowledge »

Hi all,

I am getting data in notepad ...I have file format which defines what every line means ,
data is as follows:

1
UNCERTIFIED - 5 YEAR
-
12345 12345 123450
- NJ DEPT OF TRANSPORTATION
xxxxxxxxxxxxxxxx
xxxxx xx xxxxx
-
122456 07 16 2008 x
0 DRIVER NOT FOUND
1
UNCERTIFIED - 5 YEAR
-
12345 12345 12345 xxxx x xxxxxxxxxx
0 xxxxxxxxxxx xxxxxx xx xxxxxxxx
- NJ DEPT OF TRANSPORTATION D
xxxxxxxxxxxxxxxxxx
xxxxxx xx 12345 12 31 2011
-
AB030290 07 16 2008 A
0
0 NO VIOLATION RECS FOUND FOR DRIVER
0 CURRENT STATUS - IN GOOD STANDING


thus lines continues with more records.....
.............................................

I am really not sure how to load this file .............I have mapping which says hot to load particular field :line no. what is the length of field .......start position.

Please provide me the input ........if the requirements are not clear( i did not understand too) pl let me know ,

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

Post by chulett »

Looks like you are reading a report... what do you need to do with this? It seems to me you'll need to read this as one long string and attempt to parse out just the parts you are interested in.
-craig

"You can never have too many knives" -- Logan Nine Fingers
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

read the file sequentially and on a transformer stage, define varibales to store the line no. . Read records as one column. and then seperate fields
knowledge
Participant
Posts: 101
Joined: Mon Oct 17, 2005 8:14 am

Post by knowledge »

thanks for ur quick reply ,

as u said .........i could view this file with seq stage with just one column , i did not understand what to do next ...........pl sugest
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Suggest you tell us what you need to do with this file - what bits do you need from it and what will you be doing with those bits.
-craig

"You can never have too many knives" -- Logan Nine Fingers
knowledge
Participant
Posts: 101
Joined: Mon Oct 17, 2005 8:14 am

Post by knowledge »

I have to read this file ,

every record starts with 'UNCERTIFIED - 5 YEAR' then I have 8 lines following that header , I m planning to create staging table to store these 8 lines into 8 columns thus store first record , when i hit 'UNCERTIFIED - 5 YEAR' again that means its 2nd record ......8 lines .......8 columns .......

I am not sure how to do it in datastage ............
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Use a transform stage with stage variables. One variable could be "svLineNo" and be derived as "IF In.Column='UNCERTIFIED - 5 YEAR' THEN 0 ELSE svLineNo+1". Then, depending on the value of svLineNo, you can output the appropriate column/line value out of the transform stage.
knowledge
Participant
Posts: 101
Joined: Mon Oct 17, 2005 8:14 am

Post by knowledge »

I can not see the entire code ............I tried to take premium membership couple of times but during the process screen just disappears.........


can u please send full answer...........
knowledge
Participant
Posts: 101
Joined: Mon Oct 17, 2005 8:14 am

Post by knowledge »

hi guys ,

thanks a lot for your help, at least i could create afile , and captured diff lines thro' stage variables
Post Reply