Can I Create a Sequential File on fly

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
Sairam
Participant
Posts: 42
Joined: Tue Nov 11, 2003 1:09 pm

Can I Create a Sequential File on fly

Post by Sairam »

Hi gurus ,

I have a requirement where in I need to create a Sequentail file on fly ,but the name of the Sequentail file created should be concatination of few columns

Like Sequential File Name :SSN:DateTime

Any sugestions will be appreciated


Thanks in Advance

Sairam
afssekar
Participant
Posts: 11
Joined: Fri Apr 23, 2004 10:24 am
Location: chennai

Yes possible

Post by afssekar »

yes
netboyks
Participant
Posts: 20
Joined: Sat Mar 08, 2003 7:43 am

Post by netboyks »

Create a routine and call the routine in the job which when necessary. I found it the easiest way to do.
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

Modify this Sample Rountine

$INCLUDE DSINCLUDE JOBCONTROL.H
$INCLUDE DSINCLUDE DSJ_XFUNCS.H


ErrCode = 0 ;* set this to non-zero to stop the stage/job
hJob1 = ''


hJob1 = DSAttachJob(Arg1, DSJ.ERRFATAL)
If NOT(hJob1) Then
Call DSLogFatal("Job Attach Failed:" : Arg1, "JobControl")
Abort
Ans = -1
End
ErrCode = DSSetParam(hJob1, "CONNECTSTRING", Arg4)
ErrCode = DSSetParam(hJob1, "USERNAME", Arg5)
ErrCode = DSSetParam(hJob1, "PASSWORD", Arg6)
ErrCode = DSSetParam(hJob1, "HASHPATH", Arg7)
ErrCode = DSRunJob(hJob1, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob1)
Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
Call DSLogFatal("Job Failed: " : Arg1, "JobControl")
Ans = -1
End

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

Post by ray.wurlod »

Can you please explain how that DataStage BASIC code can allow a parallel job to create a dynamically-named sequential file?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Q. Can I create a sequential file on the fly?
A. You could make the sequential file name (or pathname) a job parameter, and use that parameter in the Sequential File 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.
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

Hi Ray,

Have a job that runs everyday, reads from a table and writes to a file. Now it needs to append the date to the file name (OutputMMDDYY) every run, is there a way to do it without using the routines.

We are on 7.5EE.

Thanks,
Thanks,
Vinay
diamondabhi
Premium Member
Premium Member
Posts: 108
Joined: Sat Feb 05, 2005 6:52 pm
Location: US

Post by diamondabhi »

Use date as Jobparameter.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

ray.wurlod wrote:Q. Can I create a sequential file on the fly?
A. You could make the sequential file name (or pathname) a job parameter, and use that parameter in the Sequential File stage.
You can also, as diamondabhi noted, use the date only as the job parameter. The file name need not be entirely a job parameter reference; it can be a mix of text and job parameter references, for example #TargetDir#/MyFile_#DateParam#

<silly>
Q. Can I create a sequential file on the fly?
A. No, only on the disk.
</silly>
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