Header & Footer is missing

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
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Header & Footer is missing

Post by karthi_gana »

All,

I have designed a simple job as below

Seq File --> Transformer --> FTP Stage (Plug in)

Sample file :

UHDR|2011087
1234|201101|2.67565
1234|201101|2.67565
1234|201101|2.67565
UTRL|5

when i run the job, i see only

1234|201101|2.67565
1234|201101|2.67565
1234|201101|2.67565

in the remote machine.

i.e. Header & Trailer is missing in the file (once the file FTP'ed) . why?

I don't see any info in the log. i.e. The job ran successfully.
Karthik
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Assuming your metadata matches the detail records and thus the others were silently dropping during import for metadata mismatches. Define the file as one long string instead.
-craig

"You can never have too many knives" -- Logan Nine Fingers
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

I deal primarily with COBOL datasets that have multiple record types in addition to header and trailer, so I've given some thought to what would be either easiest or least confusing.

Ideally, your header and trailer records would have as many delimiters as your detail records. That is usually unlikely, so the compromise is towards Craig's suggestion: first column identifies how much of the beginning of each record you need to identify what type it is, then have one more column for the rest of the record. Use the transformer to parse by type (substrings, usually, but index() works well with delimiters), branch off the header and trailer records and sequential-funnel them back just before the FTP stage.

Edit: The above assumes you have derivation or other editing to do on individual columns in the detail rows. Of course, if you are just passing data through, you don't have to have separate process branches.
Last edited by FranklinE on Mon Mar 28, 2011 10:05 am, edited 1 time in total.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Doesn't even need to be that 'complex', just read and send it as a varchar with no quotes and all of the records should be transferred intact.
-craig

"You can never have too many knives" -- Logan Nine Fingers
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

chulett wrote:Doesn't even need to be that 'complex', just read and send it as a varchar with no quotes and all of the records should be transferred intact.
I think i dindn't give the complete information. As you said, I just stored all the values in a single column only.

i.e.

report varchar(500)

this columns will have all the values.

reports

UHDR|2011087
1234|201101|2.67565
1234|201101|2.67565
1234|201101|2.67565
UTRL|5

i used the same column in the ftp stage also. i.e. reports varchar(500).
Karthik
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

chulett wrote:Define the file as one long string instead.
yes.

report varchar(500)

with no quotes.
Karthik
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Go back to your orignal design and add a Reject link to the Sequential File stage that reads the file. This will capture the header and trailer rows and begin a stream of processing in which you can do what you like, for example re-parse with a Column Import 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Are you saying your metadata is one varchar(500) column throughout the job and yet you still lose the header & footer? That doesn't make sense to me. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

chulett wrote:Are you saying your metadata is one varchar(500) column throughout the job and yet you still lose the header & footer?
yes.

:roll: i am unable to identify the logic hole in the job.
Karthik
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Then try Ray's approach to see if they are getting rejected for some reason.
-craig

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