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
 

 

SQL queries Conversion from DB2 to SQL Server

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

New User


Joined: 05 Dec 2007
Posts: 7
Location: Delhi

PostPosted: Wed Dec 05, 2007 11:12 am    Post subject: SQL queries Conversion from DB2 to SQL Server
Reply with quote

I am into a migration project. As part of that i need to convert DB2 to SQL server i.e. i need to make SQL queries (embedded in COBOL program) compatibale with SQL server. e.g. ':' is used in a COBOL-DB2 program for a host variable while '@' is used in SQL server for the same purpose. So if anybody can help me in either of the following:

a) Difference in SQLs in DB2 and SQL Server.
b) Any tool which converts SQL queries from DB2 to SQL server.

This is very urgent for me. please help. Let me know if you need more information.

Thanks,
Ashish
Back to top
View user's profile Send private message

dr_te_z

New User


Joined: 08 Jun 2007
Posts: 71
Location: Zoetermeer, the Netherlands

PostPosted: Wed Dec 05, 2007 12:26 pm    Post subject:
Reply with quote

More info on platform/cobolcompiler/pre-compiler please.
As far as I know there is no pre-compiler for SQL-server. So, your cobol vendor has to do the trick. If that is Micro Focus or ACU, it should not be a problem. They can convert your SQL to ODBC-calls.
Back to top
View user's profile Send private message
ashish tech

New User


Joined: 05 Dec 2007
Posts: 7
Location: Delhi

PostPosted: Mon Dec 10, 2007 4:27 pm    Post subject:
Reply with quote

yes, i m using microfocus and you are right that it will convert SQL to ODBC calls. But still i have issues:
a) SYNTAX difference in SQLs on DB2 and SQL SERVER
b) Corresponding SQLCODE on SQL SERVER. e.g. SQLCODE=-811 is for more than one row selected in DB2. What is the corresponding SQLCODE in SQLSERVER. As accordingly i need to handle the execution in the host program. Following is the list of SQLCODE on DB2 and i need corr SQLCODEs on SQLSERVER:
SQL CODE
0
100
-811
-803
-904
-913
-532
-530
-534
-501
-840
-911
-304
Back to top
View user's profile Send private message
dr_te_z

New User


Joined: 08 Jun 2007
Posts: 71
Location: Zoetermeer, the Netherlands

PostPosted: Mon Dec 10, 2007 5:41 pm    Post subject:
Reply with quote

[my personal option]
That list of negative sqlcodes is a result from sloppy programming in the past. SQLcode 0 and 100 are ANSI standards and the remaining is vendor-specific. You should never allow your program to continue when a sqlcode other than 0 or 100 has occured.

[/my personal option]

You're at a stage where you have to modify your programs.

you can do it quick & easy by looking for equivaltent sql codes for your new database vendor.... and do it again when you switch to oracle or back to db2....

or

improve the quality of you application by using more strict (ANSI/portable/agile) ) standards.
Getting a -811 is an error: treat is as such. code a "count(*)" or use a cursor if you're convinced that the SQL is 'right'.
coding '"insert" if duplicate key then "update"' is a trick. Do you allow tricks in your code? Why? There must be blocks of coding or else you should not have to worry about those codes (look at the new "merge" statement).

Clean your code until all the obscure SQL codes are eliminated and then port to windows on a friday afternoon without spoiling your weekend icon_biggrin.gif

The same for COBOL, use the ANSI85 flag to see which cobol-verbs are IBM-enhancements. Most of them are also known to Micro Focus, that's your luck, but still..... when you do adhere to ansi85 standards you can use open-cobol instead of Micro Focus and save yourself a lot of $$$
Back to top
View user's profile Send private message
ashish tech

New User


Joined: 05 Dec 2007
Posts: 7
Location: Delhi

PostPosted: Mon Dec 17, 2007 12:36 pm    Post subject:
Reply with quote

Thanks for ur help!
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 File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Conversion of a VB file to FB. isssal DFSORT/ICETOOL 1 Mon Oct 31, 2016 10:23 pm
No new posts FTP Server and FTP.DATA vasanthz All Other Mainframe Topics 2 Wed Oct 12, 2016 11:49 pm
No new posts EBCDIC to ASCII conversion using OCOPY mistah kurtz All Other Mainframe Topics 5 Tue Sep 06, 2016 2:26 pm
No new posts Comparex utility to Syncsort conversion mistah kurtz SYNCSORT 11 Fri Jul 22, 2016 1:53 pm


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