Cobol Conversion
Aug 23, 2007
This nifty function convert COBOL value to equivalent integer.
If last characer is one of these alphanumeric charactersJ -1
K -2
L -3
M -4
N -5
O -6
P -7
Q -8
R -9
} -0it means that complete value is negative and last character is the equivalent numeric in table above.CREATE FUNCTION [dbo].[fnCobol2Int]
(
@Item VARCHAR(18)
)
RETURNS BIGINT
AS
BEGIN
RETURNCAST(
CASE
WHEN @Item LIKE '%[^}jklmnopqr0123456789JKLMNOPQR]%' THEN NULL
WHEN LEFT(@Item, LEN(@Item) - 1) LIKE '%[}jklmnopqrJKLMNOPQR]%' THEN NULL
WHEN RIGHT(@Item, 1) LIKE '[}jklmnopqrJKLMNOPQR]' THEN '-'
ELSE ''
END + LEFT(@Item, LEN(@Item) - 1) + CHAR(47 + CHARINDEX(RIGHT(@Item, 1), '}JKLMNOPQR0123456789}jklmnopqr') % 10) AS BIGINT)
END
E 12°55'05.25"
N 56°04'39.16"
View 1 Replies
ADVERTISEMENT
Jul 8, 1999
I am a novice in data base designing. I have MS certification in both design, implementation and administration. Can anyone help me provide information regarding converting from Cobol flat files to sql server tables ?
I will be very grateful.. This is my first assignment.. Got to prove myself... help....
View 5 Replies
View Related
Sep 22, 2006
I'm not "cobol person" but now, I have to bind a cobol application (from mainframe) to query SQL 2005
Have somebody had this task?
View 4 Replies
View Related
Oct 21, 1999
I developed a database in MS SQL server7. But the main database was developed in COBOL. Is there anyway I can upload my
database to mainfram? Thank you in advance.
View 1 Replies
View Related
Apr 16, 2007
Hi,
I have a need to convert sql server data to cobol format. Has anyone done this?
View 3 Replies
View Related
Jun 17, 2015
In DB2 stored procedures are calling external cobol code/program, I want convert DB2 stored procedure to MS SQL stored procedure, on that case, How to call call cobol from MS SQL stored procedure.
View 7 Replies
View Related
Mar 14, 2007
Hi
I am new to this forum and SSIS also.
I searched but could not find any answer here so I am posting my question.
We get some cobol text file that has Zoned Decimal also.
We want to use SSIS to convert the file in to SQL Server Database but we want to avoid using 3rd party s/w..
In DTS it was not possible..
Is it possible to convert Zoned Decimal to Decimal in SQL Server.
Thanks in advance.
PraRav
View 17 Replies
View Related
May 14, 2007
Hi ,
Just wondering what is the way to connect to Cobol VSAM files (data in array format) using SSIS ?
Where can I get the OLEDB/ODBC drivers for the same?
Thx,
Gaurav
View 3 Replies
View Related
Mar 1, 2007
Here is my idea but I am looking for the best practice.
Each record can have 3 possibilites.
I would read and write the data 3 times to different tables and add an identity key on all 3 files then I would reassembe the data back together on the identity key and map the data to a fourth and final table.
Any other ideas?
Thanks,
Larry
View 2 Replies
View Related
Nov 19, 2015
Is there a easier way to handle cobol book and file in SSIS ?
I have a file that has records with in one line and they are recurring. I am not sure how to explain but below is a sample format.
Header
Account
Department
Header record1
Record 1
record 2
record 2
Record 1
record 2
record 3
Header record2
Record 1
record 2
record 2
Record 1
record 2
record 3
View 9 Replies
View Related
Jan 7, 2008
Hi Experts,
I am extracting data from SQL Server 2005 to flat file destination. I am using SQL Command to specify the data selection query. One of my query uses Replicate function to derive a column value. When I execute this package it fails with the error "Data conversion failed. The data conversion for column "value" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page".
The reason for the problem is that, it is taking the InputColumnWidth of the flat file destination as 8000 and I specified the OutputColumnWidth as 4.
If I change the OutputColumnWidth to 8000, it is working without any error but resulting in the column width of 8000.
I tried using DerivedColumn Transformation's Type cast and DataConversion Transformation but still I am getting the same error in the respective Transformation components.
Can anyone suggest how to solve this issue.
View 11 Replies
View Related
Apr 12, 2000
just wondering if anyone out there has any advice or feedback regarding an upgrade conversion from 6.5 to 7.0 via the wizard? is this as straightforward as it sounds?
the only bad thing i have heard is when an upgrade is done from 6.5 to 7.0 and the 6.5 database utilized system tables . . . any feedback would be sincerely appreciated.
thank you in advance!
View 2 Replies
View Related
Jan 15, 2007
I want to convert a table in sql server2000 to DBF .
I need to this script in sql server2000
thanks
Ahmad
View 3 Replies
View Related
Nov 23, 1998
Anyone know how I can convert a Access97 database to SQL 6.5?
Or better yet.. how can I import a text file into SQL Server 6.5? The fields are seperated by fixed-width spaces.
thanks!
View 3 Replies
View Related
Jul 17, 2001
Hello, I would like to convert some of the rows in a column that has a data type of int to a decimal. Should I change the data type of the whole field to decimal or numeric, it seems like no matter what I do I cannot get certain rows to come up with a decimal number even though when I run a cast or convert it gives me the correct number of rows affected when I look at the data it is still in int format. Although this seems simple I am not having any luck getting this to work. Any help would be appreciated.
Thanks
View 1 Replies
View Related
Jun 17, 2004
Hi Techies,
We had a database MS-Access with DAO statements and we are upgrading our Database to MS-SqlServer which in need to convert the DAO statements to ADO statements.
What i want to know is there any free tool which converts automatically to convert DAO statements to ADO statements. If so what is it?
If not what is the easiest procedure to convert or otherwise should I have to do it manually convert all those DAO statements(so many). If I have to do it manually can u explain where i need to take care mainly while converting the statements.
Thank U
View 1 Replies
View Related
May 17, 2004
Hello All,
I am in the process of converting my database's columns from char/varchar/text to nchar/nvarchar/ntext.Most of the columns have foreign keys/indexes defined on them.I need to get this done programmatically.Any scripts or help would be invaluable.
Thanks!
View 3 Replies
View Related
Dec 20, 2006
I have a decimal property in a chart, when I tell for crystal if it will be null pass '-', since I can do
grato
Marcos S. Santos
View 9 Replies
View Related
Feb 24, 2007
Hi!
I have a Fact_ETL process with several Lookups.
I need to compare a ID-string datatype DT_14 from OLE DB Source to string DT_18 from Dim_salesperson. Then I would collect the ID's from Dim_salesperson into OLE DB Destination. Tried to convert DT_14 to DT_18 before Lookup. No, not working. Decimal[DT_Decimal] not working either...
I would be so grateful if someone could give an idea...
View 3 Replies
View Related
Jul 20, 2005
Hi,How do you convert DDL statements of SQL Server, which aregenerated by DTS into other database vendors' syntax (IBMDB2 or Oracle)?Any utility tool?Thank you,--jaques
View 2 Replies
View Related
Mar 18, 2008
how can i convert 061934 to Jun 01 1934?
thanks.
View 15 Replies
View Related
Mar 26, 2007
Hi all, i have an sdf file with me and i want to transfer the contents to an mdf file is there any way to do this with out the insert commands..can anyone throw light on this one?
View 4 Replies
View Related
Oct 24, 2007
Hi All.
I have MS sql server 2000 database back up. Its Extension is .bkp
I want to import this file in sql express. i want to use this in sql server 2005. how can i do this, please can you write me step.
Thanks.
Zahyea.
View 3 Replies
View Related
Nov 6, 2007
Hi,I keep getting the error:System.Data.SqlClient.SqlException: Conversion failed when converting the varchar value '@qty' to data type int. When I initiate the insert and update.I tried adding a: Convert.ToInt32(TextBox1.Text), but it didn't work.. I also tried fiddling with the update code, but I think it is to do with the insert bool as the update works at the moment.. Could someone help?My code:private bool ExecuteUpdate(int quantity){ SqlConnection con = new SqlConnection();
con.ConnectionString = "Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated
Security=True;User Instance=True"; con.Open(); SqlCommand command = new SqlCommand(); command.Connection = con; TextBox TextBox1 = (TextBox)FormView1.FindControl("TextBox1"); Label labname = (Label)FormView1.FindControl("Label3"); Label labid = (Label)FormView1.FindControl("Label13"); command.CommandText = "UPDATE Items SET Quantityavailable = Quantityavailable - '@qty' WHERE productID=@productID"; command.Parameters.Add("@qty", TextBox1.Text); command.Parameters.Add("@productID", labid.Text); command.ExecuteNonQuery(); con.Close(); return true;} private bool ExecuteInsert(String quantity) { SqlConnection con = new SqlConnection();
con.ConnectionString = "Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated
Security=True;User Instance=True"; con.Open(); SqlCommand command = new SqlCommand(); command.Connection = con; TextBox TextBox1 = (TextBox)FormView1.FindControl("TextBox1"); Label labname = (Label)FormView1.FindControl("Label3"); Label labid = (Label)FormView1.FindControl("Label13");
command.CommandText = "INSERT INTO Transactions
(Usersname,Itemid,itemname,Date,Qty) VALUES
(@User,@productID,@Itemsname,@date,@qty)"; command.Parameters.Add("@User", System.Web.HttpContext.Current.User.Identity.Name); command.Parameters.Add("@Itemsname", labname.Text); command.Parameters.Add("@productID", labid.Text); command.Parameters.Add("@qty", Convert.ToInt32(TextBox1.Text)); command.Parameters.Add("@date", DateTime.Now.ToString()); command.ExecuteNonQuery(); con.Close(); return true; }protected void Button2_Click(object sender, EventArgs e){ TextBox TextBox1 = FormView1.FindControl("TextBox1") as TextBox; ExecuteUpdate(Int32.Parse(TextBox1.Text) );}protected void Button2_Command(object sender, CommandEventArgs e) { if (e.CommandName == "Update") { TextBox TextBox1 = FormView1.FindControl("TextBox1") as TextBox; ExecuteInsert(TextBox1.Text); } } Thanks so much if someone can!Jon
View 3 Replies
View Related
Nov 7, 2007
Hi does anybody know how to programmatically convert an SQL Server table into a dbf or an excel spreadsheet? I'm using C#. Also, i need to put the new table into a different folder. Thanks.
View 3 Replies
View Related
Mar 17, 2008
Hello boyz and girlz,
Little question:
I want to write the current date and time into a database with following code:
Dim time As DateTime
time = DateTime.Now
connection.Open()
cmd.CommandText = "INSERT INTO tblOpmerkingen(Time )values('" + time + "')"
cmd.Connection = connection
But: My "time" is DD/MM/YYYY HH/mm/SS
and in my database time = MM/DD/YYYY HH/mm/SS
can somebody help me?
thanx
View 6 Replies
View Related
Aug 17, 2004
I am getting a "Syntax error converting the varchar value '10,90' to a column of data type int." error when I run the following procedure:
@myList varchar(200)
SELECT column1
FROM table1
WHERE table1.ID IN (@myList)
When @myList is a single value, I get no errors. However, when @myList is a comma separated list like in the message above, I error out. I am using SQL Server 2000.
How else can I build this list of IDs? Thank you in advance for your comments.
--Colonel
View 2 Replies
View Related
Jan 14, 2005
Hello,
I have a problem converting nvarchar into numeric into a stored procedure
I've tryed:
select @ispID=convert(numeric,SUBSTRING(@isprstr1, @j+1,@i-1))
and also
select @ispID=cast(SUBSTRING(@isprstr1, @j+1,@i-1) as numeric)
but I always get the message "Error converting data type nvarchar to numeric."
I've checked the Substring returns only digits
Can somebody help me please?
Thanks
View 1 Replies
View Related
Jun 4, 2005
Dear All:
I am in the process of developing a code generation tool to generate automatically:
1- Business Layer objects
2- Object Layer objects
3- Data Layer objects
The code follows the same technique used in IssueTracker Starter Kit.
I faced somehting wierd today while trying to convert between SQL Data types to C# data types:
Check the image please, the problem is that, different value number is being given to each column type, by using both:
syscolumsn.type and syscolumns.xtype,
which one to use ? which is the best used to convert to C# ?
Are there any place where data types of SQL Server are being converted to C# data types ?
check the pic here please SQL DB
Thanks a lot
View 1 Replies
View Related
Jun 16, 2005
Hi,I tried to convert sql datetime to string (hh:mm:ss), or filetime, but i wasn't successful. Will somebody help me with my problem? I don't know how I can solve my problem really.Thank's
View 6 Replies
View Related
Aug 6, 2005
i do have date problem in sql server, i m using DD/MM/YYYY date format, & passing it to insert & update stat...& compairing it with data in table, which is not working properly, how to convert dd/mm/yyyy to mm/dd/yyyy or yyyy-mm-dd
hoping for solution soon, thanx
murli ......
View 7 Replies
View Related
Sep 21, 2005
I'm searching on a smalldatetime field in SQL Server so a typical value would be 09/21/2005 11:30:00 AM. I have a search form which offers the user a textbox to search by date and unless they enter the exact date and time, no matching records are found. Of course I want I all records for a given day to be returned. This is how I'm doing it now. Thanks.
Dim dteDate_Requested As String = txtDate_Requested.Text
If dteDate_Requested <> "" Then strSqlText += " Date_Requested='" & dteDate_Requested & "'"End If
View 5 Replies
View Related
Oct 19, 2005
I can get my DB to accept my date by doing the following: row.Item("RequestDate") = Me.fullDate.Date -----I have fulldate dimensioned as date above. However if I try to do the follwing for a Time it gives me an error when it trys to update the DB the column is set to datetime & when I check the value of the row Item in my command window it says
?row.Item("BeginTime")#6:00:00 AM# {Date}[Date]: #6:00:00 AM#
row.Item("BeginTime") = CDate(ddlBegin.SelectedValue & beginAMPM)row.Item("EndTime") = CDate(ddlEnd.SelectedValue & endAMPM)The SQL Error I get is the following:
SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.Source Error:
Line 335: row.Item("EndTime") = CDate(ddlEnd.SelectedValue & endAMPM)
Line 336: DsVacationData1.RequestData.AddRequestDataRow(row)
Line 337: SqlDataAdapter2.Update(DsVacationData1)
Line 338: DsVacationData1.AcceptChanges()
Line 339: End SubThanks for any help.
View 3 Replies
View Related