Page 1 of 1

Using Variable in BATCH SPUFI

PostPosted: Mon Sep 16, 2013 11:51 am
by sinmani
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??

Re: Using Variable in BATCH SPUFI

PostPosted: Mon Sep 16, 2013 3:00 pm
by Akatsukami
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.

Re: Using Variable in BATCH SPUFI

PostPosted: Mon Sep 16, 2013 6:56 pm
by dick scherrer
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.