Adding Parameters

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

karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Adding Parameters

Post by karthi_gana »

All,

I have created a parameter set by using 'Create Parameter' (under Parameter tab) option under 'Job Properties'.

I would like to use these parameter set across all the jobs.

I tried to add this parameter set in some other job. But it is not added properly.

Parameter name - OFFSHORE_FUNDS
Prompt - OFFSHORE_FUNDS
Type - Parameter set
Default Value - (As Pre-defined)

why?

Actually the parameter set has more than 7 parameter names. But none of them were added in the job.
Karthik
dsnovice
Participant
Posts: 38
Joined: Thu Jul 22, 2004 11:56 pm
Location: Mclean, VA
Contact:

Post by dsnovice »

that is the beauty of Parameter sets. in the job properties you will not see the parameters. When you call them in the job they will be like #PARAMETER_SET_NAME#.#PARAMETER_NAME#. So the job properties tab are lesser. And you can change the value file accordingly to have different value file for different jobs.

Thank you,

a novice
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

dsnovice wrote:that is the beauty of Parameter sets. in the job properties you will not see the parameters. When you call them in the job they will be like #PARAMETER_SET_NAME#.#PARAMETER_NAME#. So the job properties tab are lesser. And you can change the value file accordingly to have different value file for different jobs.

Thank you,

a novice
Yes...I used like

#ParameterSet.ParamaterName# in the job.

It is working fine now..

I have added some code in 'Job Control'.

when i compile the job, i got the below error message...

Compiling: Source = 'RT_BP1284/JOB.1826671666.DT.1554613094', Object = 'RT_BP1284.O/JOB.1826671666.DT.1554613094'
***************************************************************************************************************
WARNING: Variable 'ResurrectLogFile' never assigned a value.
WARNING: Variable 'JobHierarchyFile' never assigned a value.
WARNING: Variable 'SourceSystemList' never assigned a value.
WARNING: Variable 'SubjectAreaList' never assigned a value.
WARNING: Variable 'StartingMilestone' never assigned a value.
WARNING: Variable 'EndingMilestone' never assigned a value.
WARNING: Variable 'DebugMode' never assigned a value.
WARNING: Variable 'JobLinkStatisticChecksFile' never assigned a value.

Compilation Complete.
(BATCH_MJC_ZPR)

I have verified the parameter set. It contains default values for all the variable.
Karthik
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

karthi_gana wrote:
dsnovice wrote:that is the beauty of Parameter sets. in the job properties you will not see the parameters. When you call them in the job they will be like #PARAMETER_SET_NAME#.#PARAMETER_NAME#. So the job properties tab are lesser. And you can change the value file accordingly to have different value file for different jobs.

Thank you,

a novice
Yes...I used like

#ParameterSet.ParamaterName# in the job.

It is working fine now..

I have added some code in 'Job Control'.

when i compile the job, i got the below error message...

Compiling: Source = 'RT_BP1284/JOB.1826671666.DT.1554613094', Object = 'RT_BP1284.O/JOB.1826671666.DT.1554613094'
***************************************************************************************************************
WARNING: Variable 'ResurrectLogFile' never assigned a value.
WARNING: Variable 'JobHierarchyFile' never assigned a value.
WARNING: Variable 'SourceSystemList' never assigned a value.
WARNING: Variable 'SubjectAreaList' never assigned a value.
WARNING: Variable 'StartingMilestone' never assigned a value.
WARNING: Variable 'EndingMilestone' never assigned a value.
WARNING: Variable 'DebugMode' never assigned a value.
WARNING: Variable 'JobLinkStatisticChecksFile' never assigned a value.

Compilation Complete.
(BATCH_MJC_ZPR)

I have verified the parameter set. It contains default values for all the variable.
I got it..
I forgot to use parameter set name in front of the variable.

i.e

parametersetname.variablename
Karthik
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

Now...when i execute the job, i am getting the below error message....

BATCH_MJC_ZFD..JobControl (fatal error from KBAJobControl): Error occured getting parameter array from file - \bis_data\msg\mfr\offshore\parameters\Parameter_offshore_funds.ini

what i am missing?
Karthik
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

BATCH_MJC_ZFD..JobControl (KBAJobControl): Batch Configuration Data:
\bis_data\msg\mfr\offshore\paramaters\Parameter_offshore_funds.ini
15
30
2
99
S
\bis_data\msg\mfr\offshore\log\BATCH_MJC_ZFD.CSV

1554622751




N
\bis_data\msg\mfr\offshore\log\BATCH_MJC_LINK_STAT_ZFD.log

\bis_data\msg\mfr\offshore\log\BATCH_MJC_RESURRECT_ZFD.log
next message...
BATCH_MJC_ZFD..JobControl (Routine: GetParameterArray): Values loaded from file: \bis_data\msg\mfr\offshore\paramaters\Parameter_offshore_funds.ini
next message...
BATCH_MJC_ZFD..JobControl (fatal error from KBAJobControl): Error occured getting parameter array from file - \bis_data\msg\mfr\offshore\paramaters\Parameter_offshore_funds.ini
Karthik
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

KBA doesn't "speak" parameter sets. It was written long before there was any such thing, so you may need to modify the "GetParameter" routines to support them properly. Before you ask, I have no idea if you'd need to do that or exactly how to do that off the top of my head and no DataStage access of any kind to play with it.

Let me ask you this - what exactly do you have in your ".ini" file for these new values? It parses around the equal sign, so assuming no change to the DSSetParam() function for a member of a parameter set, you may simply need to make sure they look something like this:

Code: Select all

REGULAR_PARAM=whatever
PARAMETER_SET.SET_PARAM=whatever
:idea: Some advice - I'd be very careful messing with that KBA stuff unless you thoroughly understand what it (and you) are doing. There are a lot of plates spinning when it runs, all kinds of things going on and it would be pretty simple to end up with nothing but broken plates scattered across the floor. :wink:
-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 »

Content of my .ini file

Code: Select all

* parameters.ini file
[Directories]
InputFileDirectory=\bis_data\msg\mfr\offshore\input\
LogFileDirectory=\bis_data\msg\mfr\offshore\log\
HashFileDirectory=\bis_data\msg\mfr\offshore\hash\
RejectFileDirectory=\bis_data\msg\mfr\offshore\reject\
LoadFileDirectory=\bis_data\msg\mfr\offshore\datasets\
ParameterFileDirectory=\bis_data\msg\mfr\offshore\parameters\


[Servers]
** DEV
SourceDSN=MF_DEV
SourceUser=
SourcePwd=

[Exception Handling]
JobRuntimeNotificationValue=30
JobRuntimeShutdownValue=360
JobWarningMessageNotificationValue=50
JobWarningMessageShutdownValue=200

[MISC]
NullDate=1799-01-01
SkipParameters=SourceSystemCode
SystemType=NT
NotifyStartStop=N
PerformJobLinkStatisticsChecks=N
OutputJobLinkStatistics=Y
PerformDirectorySlashAppending=Y
PerformAuditTableUpdates=N
AuditTableCriticality=WARN
AuditTableUpdateInterval=5
CompileJobsAtStartup=N

[Master Job Control Tunables]
MaxJobsParallel=20
REGULAR_PARAM=whatever
PARAMETER_SET.SET_PARAM=whatever
I am not getting this code...though i will take a look at DSSetParam() function and get back to you...
Karthik
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

An INI file is not code. An INI file contains data read by code during its initialization phase.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

ray.wurlod wrote:An INI file is not code. An INI file contains data read by code during its initialization phase.
oops...i selected the wrong one

content of GetParam() is

LOCATE ParamName IN ParamList<1> SETTING Pos THEN
Ans = ParamList<2,Pos>
END ELSE
Ans = ""
END
Karthik
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, you didn't 'select the wrong one'. I don't need to see any code, I've got all of the KBA stuff here.

Which parameter in your .ini file is part of the parameter set? All I was trying to show you was that you'll probably need to fully qualify the parameter name with the parameter set name in the ini file, something I don't see you doing.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

karthi_gana wrote:I have added some code in 'Job Control'.
Ok, maybe there is a need to see some code. Tell me what the heck that means. What "code" did you add and what were you trying to accomplish? Where exactly did you add it? Did you mean you edited the KBA code or you put something under the 'Job Control' tab of some other job? I don't think we've even gotten to your actual parameter set question quite yet. :?

This problem... is it localized to this one job you had problems compiling or is it now a problem for all jobs running under KBA control?
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

karthi_gana wrote:BATCH_MJC_ZFD..JobControl (fatal error from KBAJobControl): Error occured getting parameter array from file - \bis_data\msg\mfr\offshore\parameters\Parameter_offshore_funds.ini
By the way, this error should simply mean that it either couldn't find or couldn't open the file. Check your path and permissions.
-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 »

I have added the below code under 'JobControl'.

Code: Select all

 
DEFFUN KBAJobControl(A) Calling "DSU.KBAJobControl"
DEFFUN KBAGetParameterArray(A) Calling 'DSU.KBAGetParameterArray'
DEFFUN MFRGetlist(A) Calling 'DSU.MFRGetlist'


      SystemType = (IF SYSTEM(91) = 0 THEN "UNIX" ELSE "NT")

      ParameterArray = KBAGetParameterArray(ParameterFile)

*
*  Retrieve the next batch processing id
*

      If BatchNumber = "" Then BatchNumber = @DATE:@TIME'R%5'
      If ProcessDate = "1000-01-01" Then ProcessDate = Oconv(@DATE,"D-YMD[4,2,2]")

*
*  Derive any runtime parameters not found in parameter file
*

SlashCnt = Count(ResurrectLogFile,"\")
DirName =  Field(ResurrectLogFile,"\",1,SlashCnt):"\"
FileName = MFRGetlist(DirName:"ZFDFilelist.txt") 


*ExtraParameters = ""


*ExtraParameters<-1> = "FileSrc=":FileName[1,2]
*ExtraParameters<-1> = "FileFreq=":FileName[3,1]
*ExtraParameters<-1> = "FileType=":FileName[4,1]
*ExtraParameters<-1> = "FileCode=":FileName[5,3]
*ExtraParameters<-1> = "FeedDate=":FileName[8,8]
*ExtraParameters<-1> = "FileExtn=":FileName[17,3]

      CONVERT @AM TO @VM IN ExtraParameters
*
*  Configure job control array
*
      JobControlArray = ""
      JobControlArray<1> = ParameterFile
      JobControlArray<2> = 15                ; * How many seconds delay between alarms (minutes * 60 seconds)
      JobControlArray<3> = 30                ; * How many seconds a job can run until the alarm rings(minutes * 60 seconds)
      JobControlArray<4> = 2                 ; * Polling interval in seconds
      JobControlArray<5> = 99                ; * Maximum jobs to have running in parallel (in this batch)
      JobControlArray<6> = "S"               ; * (S) Stop entire jobstream on first job failure (P) Proceed after job failure, truncating that particular sub-jobstream
      JobControlArray<7> = JobHierarchyFile  ; * Job hierarchy file
      JobControlArray<8> = ProcessDate       ; * Common date for all jobs
      JobControlArray<9> = BatchNumber       ; * Batch number
      JobControlArray<10> = SourceSystemList           ; * Source system list (optional)
      JobControlArray<11> = SubjectAreaList  ; * Subject area list (optional)
      JobControlArray<12> = StartingMilestone          ; * Starting milestone (optional)
      JobControlArray<13> = EndingMilestone  ; * Ending milestone (optional)
      JobControlArray<14> = DebugMode        ; * Y = extra output messages
      JobControlArray<15> = JobLinkStatisticChecksFile
      JobControlArray<16> = ExtraParameters  ; * Extra parameters not within the parameter file (optional subarray - @VM separated)
      JobControlArray<17> = ResurrectLogFile

      JobFailedCount = KBAJobControl(JobControlArray)
      If JobFailedCount > 0 Then 
          Call DSLogWarn("Jobs failed", "Msg")
          Abort
      End 
     Else 
         Call DSLogInfo("Jobs finished okay", "Msg")
         vRemoveCmd = "del "
         aLogMsgs = "Deleting Resurrect Log File"
         vCmd = vRemoveCmd:ResurrectLogFile
         vSystemType = "DOS"
         Call DSExecute(vSystemType, vRemoveCmd:ResurrectLogFile, pScreenOutput, pSystemReturnCode)
         Call DSLogInfo(vLogID:aLogMsgs:ResurrectLogFile:pScreenOutput:pSystemReturnCode:vCmd, vLogID)
      End
Karthik
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

chulett wrote:
karthi_gana wrote:BATCH_MJC_ZFD..JobControl (fatal error from KBAJobControl): Error occured getting parameter array from file - \bis_data\msg\mfr\offshore\parameters\Parameter_offshore_funds.ini
By the way, this error should simply mean that it either couldn't find or couldn't open the file. Check your path and permissions.
I have given the FullControl to all the relevant group.
Karthik
Post Reply