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
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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