IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Loading DB2 from file Depending on a Particular Value


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ksk

Active User


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

PostPosted: Thu Oct 23, 2008 3:53 pm
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
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

Superior Member


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

PostPosted: Sat Nov 08, 2008 2:17 am
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: 355
Location: New York

PostPosted: Mon Nov 10, 2008 9:51 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top