Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Loading DB2 from file Depending on a Particular Value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Thu Oct 23, 2008 3:53 pm    Post subject: Loading DB2 from file Depending on a Particular Value
Reply with quote

Hi,

I have an input file with an indicator as last character. Depending on the last character, we have to either "UPDATE" or "INSERT" or "DELETE" the record of the table. Can we do this using DSNUPROC utility?

E.g., I have records as shown below.

Code:

11111    243243   4664346  U
22222    364553   3466344  M
33333    333333   8788674  D


Here "U", "M", "D" are indicators and Let's say these are at 40th position in the input file. If this indicator is "U", I want to insert the record into table; if "M", update the record and so on....

I know, we can do this using COBOL-DB2 program but can we do it using DSNUPROC utility?

KSK
Back to top
View user's profile Send private message

hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Fri Nov 07, 2008 4:50 pm    Post subject: Reply to: Loading DB2 from file Depending on a Particular Va
Reply with quote

Hi,

I am not sure if you can do this in single step. Still, I would suggest one way of doing this.

1) Split the input file into 3 different files using SORT
File1 : with all 'U' recs
File2 : with all 'I' recs
File3 : with all 'D' recs

Then run 3 differnt bulk update, insert or delete queries. Please let me if you are looking for something else.

Thanks,
-Kapil.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Sat Nov 08, 2008 2:17 am    Post subject:
Reply with quote

Hi,

I don't find any such
Quote:
Depending on the last character, we have to either "UPDATE" or "INSERT" or "DELETE" the record of the table. Can we do this using DSNUPROC utility?
references so far to accomplish this. Best approches I can think of for now are - one which you suggested & other is what Kapil has told.
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Mon Nov 10, 2008 9:51 am    Post subject:
Reply with quote

Kapil/Anuj,

Thanks for your suggetions. I am doing through COBOL-DB2 program for now.

KSK
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us