Using Variable in BATCH SPUFI



IBM's flagship relational database management system

Using Variable in BATCH SPUFI

Postby sinmani » Mon Sep 16, 2013 11:51 am

Hi Forum,

I have got a new requirement in my assignment.
My current batch SPUFI looks somewhat like :

UPDATE DB2XX.MMMMM OL
SET MAINT_LAST_DT = CURRENT_DATE
,BO_UNRLS_QT = 0.00
WHERE OL.CORP = '01'
AND OL.DIV_NO = '605'
AND ITEM IN ('5113', '6111', '6112', '6113', '6114',
'6115')
;;;;;

Now this ITEM list is all set to grow every now and then and that too into a big list.

What I have been asked to do is make this ITEM = List into a variable. New item numbers can be added to that variable separately and the SPUFI will remain the same.
Something Like :


UPDATE DB2XX.MMMMM OL
SET MAINT_LAST_DT = CURRENT_DATE
,BO_UNRLS_QT = 0.00
WHERE OL.CORP = '01'
AND OL.DIV_NO = '605'
AND ITEM = List Variable;;;;;;

:- where list variable is a dynamic list which has to be maintained separately.

Can anyone help how this can be achieved??
-----------------------------------------
As long as you think you are a student, you are doing well.
The day you consider yourself as the master of the game..........well
sinmani
 
Posts: 93
Joined: Thu Mar 22, 2012 10:02 am
Has thanked: 14 times
Been thanked: 0 time

Re: Using Variable in BATCH SPUFI

Postby Akatsukami » Mon Sep 16, 2013 3:00 pm

You have to fabricate the input to your "batch SPUFI" (almost certainly a misnomer for DSNTIAD) using some tool as *Sort or Rexx, and then submit the job by writing it to the internal reader or using the TSO SUBMIT command.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Using Variable in BATCH SPUFI

Postby dick scherrer » Mon Sep 16, 2013 6:56 pm

Hello,

If the "query" is in a file or member rather than inline, the query can be split into 2 - the first is the constant and the other is the variable value(s). Concatenate the 2 into the job.
Hope this helps,
d.sch.

These users thanked the author dick scherrer for the post:
sinmani (Mon Sep 16, 2013 8:36 pm)
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post