View previous topic :: View next topic
|
Author |
Message |
sandy mf
New User
Joined: 26 Jun 2011 Posts: 7 Location: India
|
|
|
|
I have below unload control card:
Code: |
UNLOAD
DIRECT AUTO
SORTDEVT SYSDS
SORTNUM 64
LIMIT 0
SHRLEVEL CHANGE
CONSISTENT NO
ON FAILURE UNLOAD TERMINATE UTILITY
CNTLCARDS DB2LOAD
SELECT A.COL1,
A.COL2,
(CASE WHEN DATE(COL3) = CURRENT DATE
THEN COL3
ELSE 0 END) AS COL3,
B.COL4
FROM TABLE1 A, TABLE 2 B
WHERE B.COL1 = A.COL1 |
Now, the requirement is instead of using current date in the above query we need to pick up the date from a mainframe PS file. Can someone please guide me if can give a PS file as an input to the BMC utility, and what changes needs to be done in the above query. If you can give me a sample JCL and control card for the above scenario, that would be helpful
Thanks
Sandeep
Code'd |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
One way is to have your sort product read this PS file having date in it and build the unload card dynamically and use it |
|
Back to top |
|
|
sandy mf
New User
Joined: 26 Jun 2011 Posts: 7 Location: India
|
|
|
|
Thanks Arun.
It would be helpful for me if you can post a sample JCL and Control card performing such activity |
|
Back to top |
|
|
sandy mf
New User
Joined: 26 Jun 2011 Posts: 7 Location: India
|
|
|
|
Can't this be acheived by BMC unload utility alone |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
sandy mf wrote: |
Can't this be acheived by BMC unload utility alone |
My Unload+ manual does not show any options for reading data sets and incorporating that data into the control cards. To the left, using *Sort (or Rexx; Arun and I have different skill sets) to generate the required cards is so trivial that there can be no rational reason not to do it. |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Is it possible for your date input be placed in a control card?
For example:
Code: |
(CASE WHEN DATE(COL3) = 'yyyymmdd' |
If so, you can keep upper part of query in one card, date file/control card as shown above and bottom part of your query in another control card.
Provide all three concatenated as input to your unload step.
Let us know if you got the idea. |
|
Back to top |
|
|
|