file transfer help

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
sravanthi
Participant
Posts: 83
Joined: Fri Jun 02, 2006 5:37 am

file transfer help

Post by sravanthi »

Hi,

I have a file with header ,trailer and detail records.The header record length is 10 ,trailer record length is 15 and detail records are fixed width length of 50.

I'm currently working on ftp stage to do this.I have tried reading the file as fixed width then on remote server the file is created as fixed width with record length as 50.I need the file to same as created with diff lengths.

Then i have tried reading the file as variable then ftp stage is inserting some values in data.I have used NUL in space delim,quote etc..This is not working

I have also tried reading in single line then job is getting aborted.Any help will be great.

Thanks!
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's not fixed width, so you can't use that. Fixed width implies that every record has the same structure and, therefore, length.

Please advise what "some values" are being inserted by FTP, and which FTP mode (ASCII or binary) you are using.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sravanthi
Participant
Posts: 83
Joined: Fri Jun 02, 2006 5:37 am

Post by sravanthi »

Ray,

I have given col delim,quote char as NUL and Escape char as SPACE.

The data on remote server is now:
NHEADNNER NN 000000000000004

Instead of HEADER 000000000000004.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Fixed with implies no column delimiter at all. NUL occupies one byte. Therefore your proposed approach is not generically valid.

Read each line as a single VarChar column and parse it within a Transformer stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sravanthi
Participant
Posts: 83
Joined: Fri Jun 02, 2006 5:37 am

Post by sravanthi »

ray.wurlod wrote:Fixed with implies no column delimiter at all. NUL occupies one byte. Therefore your proposed approach is not generically valid.

Read each line as a single VarChar column and parse it within a Tr ...
Ray,

Let me explain:

Sample data file looks like:

HEADER 000000000000005
0105610095600ABX MANAGEMENT CORP. T
0208561009123ABX MANAGEMENT CORP. T
TRAILER 000000000000005 END

Header record of 25 ,Trailer record of 30 and data 65.I have to ftp this windows file to unix.So i have used sequential stage with single column with length (65) and ftp stage.
In ftp stage i have mentioned those delimiters...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Because 25 <> 30 <> 65 you can not claim that this is fixed width. Use VarChar, as I indicated. FTP does not care about delimiters; no stage does if there is only one column.
Use DIGITS Transform to extract the numeric portions of the header and trailer records, and constraint expressions in the Transformer stage to limit processing to the detail records.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply