View previous topic :: View next topic
|
Author |
Message |
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
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 |
|
|
hikaps14
Active User
Joined: 02 Sep 2005 Posts: 189 Location: Noida
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Kapil/Anuj,
Thanks for your suggetions. I am doing through COBOL-DB2 program for now.
KSK |
|
Back to top |
|
|
|