View previous topic :: View next topic
|
Author |
Message |
ykishore
New User
Joined: 12 Aug 2005 Posts: 53 Location: USA
|
|
|
|
Hi
Here is my requirement..
i have some set of SSN numbers in the i/p files and i want to delete all the records from the production table for those SSN. is there any way to do that thru Batch JCL? please help me out on this. and this is urgent. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
It is about a 10 minute program. . .
Read "the file"
Delete from table where the ssns are equal.
Very small bit of code |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Quote: |
Is there any way to do that thru Batch JCL? |
Yes. Execute an SQL Query deleting records for the specific condition thru a Batch JCL Step. |
|
Back to top |
|
|
ykishore
New User
Joined: 12 Aug 2005 Posts: 53 Location: USA
|
|
|
|
Hi
Thanks for info!! But i want to get do it thru JCL? pls let me know .. |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Quote: |
Thanks for info!! But i want to get do it thru JCL? |
What else did I talk about above ???
Go thru this link that tells you executing SQL Queries in a Batch Job. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you want to solve your requirement quickly (by your post this was "urgent"), do the simple thing - not wait for "what you want".
If you just want to find (wait for) a particular solution, it cannot be urgent. That urgency is artificial. Urgency would not include multiple days looking for a solution.
If you wanted another type of jcl fix you could always close and backup the databasae, unload the table, match the ssn file with the employee file using sort and eliminate the "matches" from the output file. Then, reload the employee table. That would need no DB2 query and no program - not a very good choice (IMHO) but does do the task "thru JCL". Of course a major drawback of that solution is that the deletes would not be recorded in the DB2 logs.
Have the ssns been deleted? |
|
Back to top |
|
|
vini_srcna
Active User
Joined: 26 May 2005 Posts: 178 Location: Copenhagen, Denmark
|
|
|
|
How many SSN's are there by the way...? If they are pretty less, you could write the SQL query to delete all records in a single query or an indivual query which ever is easy for you and execute it in SPUFI.
Thanks for info!! But i want to get do it thru JCL?
If you want that to happen through JCL, code the queries and execute it using one of the productivity aid sample programs like DSNTIAUL, DSNTEP2 or DSNTIAD etc. You could find multiple ways to execute the SQL dynamically. Let me know if this did not help you..! |
|
Back to top |
|
|
|