File Name in format Name_date_recordcount

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
pqrabc
Participant
Posts: 20
Joined: Wed Nov 18, 2009 2:59 am

File Name in format Name_date_recordcount

Post by pqrabc »

Hi,

I have a job that picks up data from database and loads into sequential file. While doing so I need the file name to be dynamic and generated in format FileName_DateMMDDYYYY_RecordCount. The file name should be parametrized. I tried using stage variable, but the scope is limited to transformer.

eg: Master_02132012_235000.

How to go about that?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It's been discussed here quite a bit. For the 'filename' portion, one approach is to pass the date in as a Job Parameter so that it can be leveraged in the output stage. Adding in the complication of the record count means you either need to pre-count the data for the file and pass that in as well or do everything after job. Meaning, write to a static output filename and then also store the information you'd need to rename the file afterwards.
-craig

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