Can I Create a Sequential File on fly
Moderators: chulett, rschirm, roy
Can I Create a Sequential File on fly
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
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
Yes possible
yes
-
- Premium Member
- Posts: 892
- Joined: Thu Oct 16, 2003 5:18 am
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
$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
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am
-
- Premium Member
- Posts: 108
- Joined: Sat Feb 05, 2005 6:52 pm
- Location: US
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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#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.
<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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.