lunes, 21 de mayo de 2018
CredSSP Encryption oracle remediation error caused by May 2018 Update
Open a cmd prompt as administrator and run this command
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters" /f /v AllowEncryptionOracle /t REG_DWORD /d 2
then try your remote desktop.
viernes, 26 de enero de 2018
Multiple Parameters WEB API
I had looked for this everywhere until I had found this sample from Mudita Rathore
http://www.c-sharpcorner.com/UploadFile/2b481f/pass-multiple-parameter-in-url-in-web-api/
while his sample is using MVC Web API it helped me a lot.
Basically I wanted to be able to search for a Person : First, Middle, and DOB
One of the solution was rooting but I wanted to have a simpler alternative.
So here are the steps very simple:
1. Create a WEB API Project using Visual Studio
2. Expand the folder Controllers
Edit the ValuesController.cs
add this GET method.
public string Get(string strFirstName, string strLastName, DateTime dtDOB)
{
return strFirstName + " " + strLastName+ " " +dtDOB.ToString() ;
}
Run the project and go to
http://localhost:PORT/api/values/?strFirstName=Jorge&strLastName=Vera&dtDOB=01/26/2018%2004:00%20PM
Where port is your assigned number port.
and you will get a xml/json return,
The key is your Parameters Name are the same as your GET Parameters
So the good part here is that you can pass parameters to your WEB API process the request access a database get the result based in the parameters received.
most of the examples I read and watched only talk about a GET method that will take and Index value or return a general list, but in the real world you need to provide several filter for the same query, a date range, a list of parameters like Client Code, Bill Number, Zipcode all of them at once.
I hope this small sample helps and again thanks to
http://www.c-sharpcorner.com/members/mudita-rathore
for his sample.
http://www.c-sharpcorner.com/UploadFile/2b481f/pass-multiple-parameter-in-url-in-web-api/
while his sample is using MVC Web API it helped me a lot.
Basically I wanted to be able to search for a Person : First, Middle, and DOB
One of the solution was rooting but I wanted to have a simpler alternative.
So here are the steps very simple:
1. Create a WEB API Project using Visual Studio
2. Expand the folder Controllers
Edit the ValuesController.cs
add this GET method.
public string Get(string strFirstName, string strLastName, DateTime dtDOB)
{
return strFirstName + " " + strLastName+ " " +dtDOB.ToString() ;
}
Run the project and go to
http://localhost:PORT/api/values/?strFirstName=Jorge&strLastName=Vera&dtDOB=01/26/2018%2004:00%20PM
Where port is your assigned number port.
and you will get a xml/json return,
The key is your Parameters Name are the same as your GET Parameters
So the good part here is that you can pass parameters to your WEB API process the request access a database get the result based in the parameters received.
most of the examples I read and watched only talk about a GET method that will take and Index value or return a general list, but in the real world you need to provide several filter for the same query, a date range, a list of parameters like Client Code, Bill Number, Zipcode all of them at once.
I hope this small sample helps and again thanks to
http://www.c-sharpcorner.com/members/mudita-rathore
for his sample.
martes, 11 de octubre de 2016
80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
We have a website application that uses a 32 bit OCX reference and We were getting the nice error
80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
This was case escenario:
We were developing using VS 2010 Asp.net running it as Administrator
Server was Windows 2012 R2 64 bits
We were using an OCX library that works in 32 bit, We installed this Library as Administrator.
Still we were getting the error.
80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
Another error We were getting was STDOLE.DLL can not be copied to the Refence folder.
Remember, the Library worked in a 32 bit app.
80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
This was case escenario:
We were developing using VS 2010 Asp.net running it as Administrator
Server was Windows 2012 R2 64 bits
We were using an OCX library that works in 32 bit, We installed this Library as Administrator.
Still we were getting the error.
80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
Another error We were getting was STDOLE.DLL can not be copied to the Refence folder.
Remember, the Library worked in a 32 bit app.
Go to the Application Pools from the IIS Manager
Right click in the application Pool , select Advanced Settings.
Enable 32-Bit applications SET IT TO TRUE
Set all the Applications Pool the same way.
Then go to your Web Application, right click on it and select Manage application then Advanced Settings
There Select the Application Pool you will be using for the Web Application you are having problems.
Compile, test, celebrate!
jueves, 25 de agosto de 2016
LinkedIn Background Image
Go to Google Image Search and search for anything you like to be your image background.
then use any capture screen software you like to capture the best combination you like,
I use screenshot captor
https://www.donationcoder.com/Software/Mouser/screenshotcaptor/
and no I am not getting any money for this :) I wish I could
here some examples:
Some Peruvian beaches

Do you like Software Companies?

and this is my current linkedin background

simple and nice. I am not a Graphic Designer so this approach will work for me.
then use any capture screen software you like to capture the best combination you like,
I use screenshot captor
https://www.donationcoder.com/Software/Mouser/screenshotcaptor/
and no I am not getting any money for this :) I wish I could
here some examples:
Some Peruvian beaches

Do you like Software Companies?

and this is my current linkedin background

simple and nice. I am not a Graphic Designer so this approach will work for me.
lunes, 8 de agosto de 2016
Tsql Tips
Sometimes you need random numbers from 1 to 1000 and without duplicated numbers, here is the link:
http://sqlperformance.com/2013/09/t-sql-queries/random-collisions
Backup all databases at once from a SQL Server?
https://www.mssqltips.com/sqlservertip/1070/simple-script-to-backup-all-sql-server-databases/
Reindex all tables in a DB TSQL
http://blog.sqlauthority.com/2015/02/15/interview-question-of-the-week-007-how-to-reindex-every-table-of-the-database/
http://sqlperformance.com/2013/09/t-sql-queries/random-collisions
Backup all databases at once from a SQL Server?
https://www.mssqltips.com/sqlservertip/1070/simple-script-to-backup-all-sql-server-databases/
Reindex all tables in a DB TSQL
http://blog.sqlauthority.com/2015/02/15/interview-question-of-the-week-007-how-to-reindex-every-table-of-the-database/
lunes, 25 de enero de 2016
Bulk Insert Notes
How to Fix Error :
Msg 4866, Level 16, State 7, Line 2
The bulk load failed. The column is too long in the data file for row 1, column 1. Verify that the field terminator and row terminator are specified correctly.
Msg 7399, Level 16, State 1, Line 2
The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7330, Level 16, State 2, Line 2
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".
Solution:
So I changed this " 2 " to " 0 "
10.0
59
1 SQLCHAR 0 20 "" 1 "RecordType" SQL_Latin1_General_CP1_CI_AS
2 SQLCHAR 0 50 "" 2 "FullName" SQL_Latin1_General_CP1_CI_AS
3 SQLCHAR 0 9 "" 3 "CompanyID" SQL_Latin1_General_CP1_CI_AS
Msg 4866, Level 16, State 7, Line 2
The bulk load failed. The column is too long in the data file for row 1, column 1. Verify that the field terminator and row terminator are specified correctly.
Msg 7399, Level 16, State 1, Line 2
The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7330, Level 16, State 2, Line 2
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".
Part of my format file is like this
10.0
59
1 SQLCHAR 2 20 "" 1 "RecordType" SQL_Latin1_General_CP1_CI_AS
2 SQLCHAR 2 50 "" 2 "FullName" SQL_Latin1_General_CP1_CI_AS
3 SQLCHAR 2 9 "" 3 "CompanyID" SQL_Latin1_General_CP1_CI_AS
Solution:
So I changed this " 2 " to " 0 "
10.0
59
1 SQLCHAR 0 20 "" 1 "RecordType" SQL_Latin1_General_CP1_CI_AS
2 SQLCHAR 0 50 "" 2 "FullName" SQL_Latin1_General_CP1_CI_AS
3 SQLCHAR 0 9 "" 3 "CompanyID" SQL_Latin1_General_CP1_CI_AS
Please notice the differences line per line
/*****************************************************/
How to Fix Error :
Msg 4823, Level 16, State 1, Line 3
Cannot bulk load. Invalid column number in the format file "C:\COMPANIES.fmt".
Format File is like this:
10.0
59
1 SQLCHAR 0 20 "" 1 [RecordType] SQL_Latin1_General_CP1_CI_AS
2 SQLCHAR 0 50 "" 2 FullName SQL_Latin1_General_CP1_CI_AS
3 SQLCHAR 0 9 "" 3 [CompanyID] SQL_Latin1_General_CP1_CI_AS
4 SQLCHAR 0 3 "" 4 [Column 3] SQL_Latin1_General_CP1_CI_AS
Solution:
Changed the Square Brackets for double quotes
10.0
59
1 SQLCHAR 0 20 "" 1 "RecordType" SQL_Latin1_General_CP1_CI_AS
2 SQLCHAR 0 50 "" 2 FullName SQL_Latin1_General_CP1_CI_AS
3 SQLCHAR 0 9 "" 3 "CompanyID" SQL_Latin1_General_CP1_CI_AS
4 SQLCHAR 0 3 "" 4 "Column 3" SQL_Latin1_General_CP1_CI_AS
/*****************************************************/
How to Fix Error :
Msg 4862, Level 16, State 1, Line 3
Cannot bulk load because the file "C:\crane\COMPANIES.fmt" could not be read. Operating system error code (null).
Solution:
Open your format file press Ctrl-End you should be going to the last line.
If your last line is a column definition you need to go to the end of that line, press enter and Save it.
so you must have an EMPTY LAST LINE in your file.
lunes, 14 de diciembre de 2015
Rmcobol 85 tips
Couple of things.
I was looking for a copy of the manual.
https://www.yumpu.com/en/document/view/9317270/rm-cobol-users-guide-second-edition-micro-focus
I have several index files to convert to sequential you can do it in a batch this is the command line.
runcobol recover2 A="INDEXFILE.INX, SEQUENTIALFILE.TXT ,NOSUB"
I was looking for a copy of the manual.
https://www.yumpu.com/en/document/view/9317270/rm-cobol-users-guide-second-edition-micro-focus
I have several index files to convert to sequential you can do it in a batch this is the command line.
runcobol recover2 A="INDEXFILE.INX, SEQUENTIALFILE.TXT ,NOSUB"
jueves, 10 de diciembre de 2015
Export Data From Crystal Reports to Excel - Work Around
So I was requested to Export the Data from a Crystal Report to Excel with Headers.
This is a work around not the perfect solution. It worked for my request, maybe it will for you as well.
The report uses a DataTable as DataSource.
What I did I export the DataTable as comma delimited file using this method
DataTable2CSV - Saving a DataTable to a CSV file
http://www.devx.com/vb2themax/Tip/19703
Again it worked for me. I got the data and the Headers.
The Report was simple straight forward not a Master - Detail Report.
This is a work around not the perfect solution. It worked for my request, maybe it will for you as well.
The report uses a DataTable as DataSource.
What I did I export the DataTable as comma delimited file using this method
DataTable2CSV - Saving a DataTable to a CSV file
http://www.devx.com/vb2themax/Tip/19703
Again it worked for me. I got the data and the Headers.
The Report was simple straight forward not a Master - Detail Report.
Operation not yet implemented - Crystal Reports
I have this problem when the users use EXPORT AS A PDF from a Crystal Report.
The solution was simple
Grab the Arial and Times Roman Font from a XP Machine put them into a Flash Drive and copy them to the machine you are getting the problem. That will fix it.
What causes this problem? Microsoft update the fonts and they are "not compatible" with CR.
A work around is changing all the Fonts in your report to something else, mmmmm User will not wait for that I will stick with the XP Solution. I can not upload them here but you can send me a email I will send them to you if you need them.
Have a good one
The solution was simple
Grab the Arial and Times Roman Font from a XP Machine put them into a Flash Drive and copy them to the machine you are getting the problem. That will fix it.
What causes this problem? Microsoft update the fonts and they are "not compatible" with CR.
A work around is changing all the Fonts in your report to something else, mmmmm User will not wait for that I will stick with the XP Solution. I can not upload them here but you can send me a email I will send them to you if you need them.
Have a good one
viernes, 4 de diciembre de 2015
Export a Crystal Reports Data to Excel
Simple.
Private Sub btnLoadReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoadReport.Click
Try
vLoadDataSet() 'load the datatable with the records
Dim pr1 As New ParameterDiscreteValue
pr1.Value = dtDateFrom.Value.ToShortDateString
Dim pr2 As New ParameterDiscreteValue
pr2.Value = dtDateTo.Value.ToShortDateString
Dim pr3 As New ParameterDiscreteValue
pr3.Value = txtTitle.Text
Dim crSource As New RepMcLennanCCCriminalDocket
crSource.SetDataSource(dtReport)
crSource.SetParameterValue("pFrom", pr1)
crSource.SetParameterValue("pTo", pr2)
crSource.SetParameterValue("pTitle", pr3)
crViewer.ReportSource = crSource
crViewer.Refresh()
crViewer.Visible = True
crViewer.Show()
''here set the export
crSource.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile
crSource.ExportOptions.ExportFormatType = ExportFormatType.ExcelRecord
Dim objExcelOptions As ExcelFormatOptions = New ExcelFormatOptions
objExcelOptions.ExcelTabHasColumnHeadings = True
objExcelOptions.ExcelUseConstantColumnWidth = False
crSource.ExportOptions.FormatOptions = objExcelOptions
Dim objOptions As DiskFileDestinationOptions = New DiskFileDestinationOptions
objOptions.DiskFileName = "SettingList.xls"
crSource.ExportOptions.DestinationOptions = objOptions
''here export
crSource.Export()
''here open the excel
Process.Start("EXCEL.EXE", """SettingList.xls""")
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End Sub
Private Sub btnLoadReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoadReport.Click
Try
vLoadDataSet() 'load the datatable with the records
Dim pr1 As New ParameterDiscreteValue
pr1.Value = dtDateFrom.Value.ToShortDateString
Dim pr2 As New ParameterDiscreteValue
pr2.Value = dtDateTo.Value.ToShortDateString
Dim pr3 As New ParameterDiscreteValue
pr3.Value = txtTitle.Text
Dim crSource As New RepMcLennanCCCriminalDocket
crSource.SetDataSource(dtReport)
crSource.SetParameterValue("pFrom", pr1)
crSource.SetParameterValue("pTo", pr2)
crSource.SetParameterValue("pTitle", pr3)
crViewer.ReportSource = crSource
crViewer.Refresh()
crViewer.Visible = True
crViewer.Show()
''here set the export
crSource.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile
crSource.ExportOptions.ExportFormatType = ExportFormatType.ExcelRecord
Dim objExcelOptions As ExcelFormatOptions = New ExcelFormatOptions
objExcelOptions.ExcelTabHasColumnHeadings = True
objExcelOptions.ExcelUseConstantColumnWidth = False
crSource.ExportOptions.FormatOptions = objExcelOptions
Dim objOptions As DiskFileDestinationOptions = New DiskFileDestinationOptions
objOptions.DiskFileName = "SettingList.xls"
crSource.ExportOptions.DestinationOptions = objOptions
''here export
crSource.Export()
''here open the excel
Process.Start("EXCEL.EXE", """SettingList.xls""")
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End Sub
lunes, 31 de agosto de 2015
Error 2869
I was trying to install a msi file in a windows 8.1 machine and got the Error 2869
I had tried to run msiexec /i msipack.msi in a command prompt windows as administrator, still the same.
Now I knew the package i was trying to install is a .NET Framework 2 and this Windows 8.1 was a fresh installation. So I added the .Net Framework 2 and 3.5 (add/remove programs | turn windows features On or Off | check Net Framework 3.5 Includes 2) to Windows 8.1
run again the command prompt as Administrator.
Problem solved.
I had tried to run msiexec /i msipack.msi in a command prompt windows as administrator, still the same.
Now I knew the package i was trying to install is a .NET Framework 2 and this Windows 8.1 was a fresh installation. So I added the .Net Framework 2 and 3.5 (add/remove programs | turn windows features On or Off | check Net Framework 3.5 Includes 2) to Windows 8.1
run again the command prompt as Administrator.
Problem solved.
martes, 31 de marzo de 2015
Microsoft Word Automation, let word do the numbering for you
This is a simple trick,
We use MSWord to generate some quick reports for our clients, We create a table in a word document and we fill the table with the data we retrieve from SQL Server. Sometimes we need to add a number to the each Row to show the number of records or just numbering each row, so we added ROW_NUMBER ... etc to our queries, until now, because I tried this trick.
like the picture shows bellow we draw a 3 rows tables and in the row were the data will be populated i create a empty column and I clicked in the Numbering Icon from the Word Tool Bar, this will insert a number 1. in that empty column.
The result will be :
The report with a sequential number in each row, pretty simple and some time saver.
We use MSWord to generate some quick reports for our clients, We create a table in a word document and we fill the table with the data we retrieve from SQL Server. Sometimes we need to add a number to the each Row to show the number of records or just numbering each row, so we added ROW_NUMBER ... etc to our queries, until now, because I tried this trick.
like the picture shows bellow we draw a 3 rows tables and in the row were the data will be populated i create a empty column and I clicked in the Numbering Icon from the Word Tool Bar, this will insert a number 1. in that empty column.
The result will be :
The report with a sequential number in each row, pretty simple and some time saver.
miércoles, 15 de octubre de 2014
Sync a local folder with remote folder FTP a combination of Robocopy and WinSCP
Here is the situation:
1.- Robocopy, it is free and it is available on Win 7 and up, just open command prompt window and type Robocopy, press enter if you see this screen you have it, otherwise you can download it from the web.
2.- WINSCP this is a great Free FTP client that allows you to do Scripts. you can download it from: http://winscp.net/eng/download.php
before I do the steps let me explain the options i will be using from these 2 tools.
A.- Robocopy has an OPTION
B: WinSCP I will be using the Synchronize option
so now let do the steps:
It is pretty simple, removing the temp folder I am using, "d:\uploadimages"
recreating it again and copying all New/Modified documents from the last 10 days, from my source "d:\images" to my Temp folder "d:\uploadimages"
Test it and be sure you can connect.
Second. open notepad and type the following:
And save it as d:\upload.txt or any name, FTPSERVER needs to match the sever name in WinSCP.
what are we doing here is pretty simple, open a connection to the FTP server and synchronize the content of the Local folder to the Remote Folder, simple right?
now to execute this script you call it like this from Command Prompt:
cd "C:\Program Files (x86)\WinSCP\"
winscp.com /script=d:\upload.txt
you will see something like this:
and the program will compare and upload the new/modified files.
putting these 2 steps together you end with something like this:
------begin-----
save it as a Batch file and add it to the schedule task, test it and make sure it works.
I hope this helps you.
Sources:
http://winscp.net/eng/docs/task_synchronize_full#automating_synchronization
http://winscp.net/eng/docs/ui_login
http://technet.microsoft.com/en-us/library/cc733145.aspx
I need to update a FTP server with the latest documents from our client's server. Latest documents included New and Modified Documents.
I will be using 2 tools, both free.1.- Robocopy, it is free and it is available on Win 7 and up, just open command prompt window and type Robocopy, press enter if you see this screen you have it, otherwise you can download it from the web.
2.- WINSCP this is a great Free FTP client that allows you to do Scripts. you can download it from: http://winscp.net/eng/download.php
before I do the steps let me explain the options i will be using from these 2 tools.
A.- Robocopy has an OPTION
- /S : means include sub directories
- /R:n: Means retry to copy the files N times, if you use 0 then it will skip that file
- /MAXAGE:NDays: means exclude all the files older than Ndays or you can put a date.
B: WinSCP I will be using the Synchronize option
so now let do the steps:
I. Copy all the Newest Files from the Source Folder to a Temp Destination folder, to accomplish this I create the following DOS script:
rd d:\uploadimages /s /q
md d:\uploadimages
robocopy D:\Images d:\uploadimages /s /r:0 /MAXAGE:10
It is pretty simple, removing the temp folder I am using, "d:\uploadimages"
recreating it again and copying all New/Modified documents from the last 10 days, from my source "d:\images" to my Temp folder "d:\uploadimages"
II. Create the script to upload this temp folder to my FTP
First you need to define your FTP server in Winscp, follow this link http://winscp.net/eng/docs/ui_loginTest it and be sure you can connect.
Second. open notepad and type the following:
option batch on
option confirm off
open FTPSERVER
synchronize remote "d:\uploadimages" "/Client/Uploadimages"
close
exit
And save it as d:\upload.txt or any name, FTPSERVER needs to match the sever name in WinSCP.
what are we doing here is pretty simple, open a connection to the FTP server and synchronize the content of the Local folder to the Remote Folder, simple right?
now to execute this script you call it like this from Command Prompt:
cd "C:\Program Files (x86)\WinSCP\"
winscp.com /script=d:\upload.txt
you will see something like this:
and the program will compare and upload the new/modified files.
putting these 2 steps together you end with something like this:
------begin-----
rd d:\uploadimages /s /q
md d:\uploadimages
robocopy D:\Images d:\uploadimages /s /r:0 /MAXAGE:10
cd "C:\Program Files (x86)\WinSCP\"
winscp.com /script=upload.txt
------end-----save it as a Batch file and add it to the schedule task, test it and make sure it works.
I hope this helps you.
Sources:
http://winscp.net/eng/docs/task_synchronize_full#automating_synchronization
http://winscp.net/eng/docs/ui_login
http://technet.microsoft.com/en-us/library/cc733145.aspx
martes, 1 de julio de 2014
RM Cobol Error 24,02 or 34,02 Exporting a File that will be bigger than 2 GB
So I was doing this COBOL Conversion and I got this error 34,02
so I found this great link
_________________________________________________________________________________
https://community.microfocus.com/microfocus/cobol/rm_cobol/w/knowledge_base/6937.recovery-encounters-cobol-io-error-2402.aspx
Recovery encounters COBOL I/O Error 24,02
This article explains how to resolve an Index File Recovery Utility 24,02 COBOL I/O Error.
Problem:
When using the RM/COBOL Index File Recovery Utility with a large file, it can fail with a COBOL I/O Error 24,02. This error indicates that there is not enough room left to write to the file. How is this resolved?
Resolution:
This error is caused by the fact that the Index File Recovery Utility opens index files in binary sequential mode. Therefore, in order to resolve this issue, you will need to create a configuration file that enables the use of large sequential files (over 2 GB). The steps to create the configuration file are as follows:
Create a text file named runcobol.cfg in the same directory as the Runtime executable (runcobol).
Add the following configuration record: RUN-SEQ-FILES USE-LARGE-FILE-LOCK-LIMIT=YES
Save the file.
The configuration file will be loaded automatically and will allow you to successfully recover your index file.
_________________________________________________________________________________
I followed the instructions and it did not work. I got the same error again.
Then I just ran "runcobol.exe" and showed me this:
RM/COBOL Runtime - Version 7.00.02 for 32-Bit Windows (95/98/NT).
Configured for 10 users.
Copyright (c) 1985, 1986-1999 by Liant Software Corp. All rights reserved.
Registration Number: NE-0000-05800-0010
Usage: RUNCOBOL name [options]
Options: [A=arguments] [B=buffersize] [C=configfile] [D] [I] [K]
[L=libname] [M] [S=switches] [T=sortsize] [X=configmod]
so I found this great link
_________________________________________________________________________________
https://community.microfocus.com/microfocus/cobol/rm_cobol/w/knowledge_base/6937.recovery-encounters-cobol-io-error-2402.aspx
Recovery encounters COBOL I/O Error 24,02
This article explains how to resolve an Index File Recovery Utility 24,02 COBOL I/O Error.
Problem:
When using the RM/COBOL Index File Recovery Utility with a large file, it can fail with a COBOL I/O Error 24,02. This error indicates that there is not enough room left to write to the file. How is this resolved?
Resolution:
This error is caused by the fact that the Index File Recovery Utility opens index files in binary sequential mode. Therefore, in order to resolve this issue, you will need to create a configuration file that enables the use of large sequential files (over 2 GB). The steps to create the configuration file are as follows:
Create a text file named runcobol.cfg in the same directory as the Runtime executable (runcobol).
Add the following configuration record: RUN-SEQ-FILES USE-LARGE-FILE-LOCK-LIMIT=YES
Save the file.
The configuration file will be loaded automatically and will allow you to successfully recover your index file.
_________________________________________________________________________________
Then I just ran "runcobol.exe" and showed me this:
Configured for 10 users.
Copyright (c) 1985, 1986-1999 by Liant Software Corp. All rights reserved.
Registration Number: NE-0000-05800-0010
Usage: RUNCOBOL name [options]
Options: [A=arguments] [B=buffersize] [C=configfile] [D] [I] [K]
[L=libname] [M] [S=switches] [T=sortsize] [X=configmod]
Do you see it? the "C" option
so then i ran
c:\>runcobol recover2 C=runcobol.cfg
and I got my 3 GB Exported file!!!! Yes over the 2 GB Limit
You can see now it exported almost 800K records not just 242K as the initial screen
I hope this help you
Etiquetas:
2 GB,
error 24 02,
Error 34 02,
RECOVER2,
RMCOBOL,
RUNCOBOL
lunes, 23 de junio de 2014
From RM Cobol to SQL Server Without File Descriptions!!!
I was assigned to migrate an system that uses RM COBOL Data Files to a SQL Server.
The method could appear orthodox to some people, but this is what I had available.
Before I start let me tell you that the HUGE help that I had it, was that I had access to the COBOL software.
Saying that let me explain briefly what I had it done.
The method could appear orthodox to some people, but this is what I had available.
Before I start let me tell you that the HUGE help that I had it, was that I had access to the COBOL software.
Saying that let me explain briefly what I had it done.
- Identify the DATA Files
- Extract the data to text format using runcobol recover2 "Index File Recovery Utility", this is a utility from COBOL that will export Index files as TEXT files.
- Now We have several Text files but when I opened them they have "non viewable ASCII chars", those represent the 4 bytes for the begin and end of a block. When you extract the data every block is treated as it is contained in a single record. To be able to Edit this Text File I had tried SEVERAL text editors, Notepad++, Textpad, Litepad, since the files created from the utility are bigger than 1 GB it was very hard to edit them. so I found HxD - Hexeditor from http://mh-nexus.de/en/ this tool save me a lot of TIME. You can see the 4 bytes that repeat, they are the END and BEGIN of new Block or Record in this case.
- So after I identified the Begin and End of the block 4 bytes chars, (for this example 42 11 00 00 are the HEX of each byte), I did a Ctrl-R and replace all 8 bytes by a "|" Pipe char followed by a New Line or Carriage Return char, the purpose of this is to have a single line record. Now I was able to open the text file and SEE the Data at least it was more organized that the RAW data you obtain from the COBOLutility. For this task I used HxD to do the replace.
- The next 2 images show how the raw data was aligned before and after of replacing the 4 bytes at the begin and at the end of each block.
This is the RAW Data
This is the Data after being fixed
- The next steps are pretty simple you need to Import the text files to a SQL DB using SSIS and from there feed your application database, as I mention at the beginning of this article my advantage was that I was able to use the Cobol Application and using that combined with the readable text files made it really easy to identify the columns in each table.
NOTE:
- One thing that I need to add to this article was that I am not sure if the COBOL files had any COMP or COMP3 fields but when I export them as Text files I found several numbers that have a letter at the end like this little sample:
AMOUNT
0000000600}
0000000570}
0000000735L
0000000009{
0000000891L
0000000400{
0000000606C
0000000400{
0000000400}
0000000400{
0000000549C
0000000870}
0000000050{
0000000400{
0000000840C
0000000400{
- There is a simple logic that you need to applied to obtain the right value, you need to replace the non numeric char for a number as is being describe in the script bellow
Etiquetas:
COBOL,
DTS,
Flat File,
HxD Hexeditor,
SQL SERVER,
SSIS,
TextPad
lunes, 31 de marzo de 2014
Upgrading your Office/Home from Windows XP
This task seems to be very easy, just insert the new Windows Disk and upgrade your windows XP machine just clicking next ... right?
well you need to do some work :)
there are 2 things associated to your Windows XP: Hardware and Software
Let start with Hardware: do a list of the hardware in your office/Home: Scanner, Printers, Faxs, Cameras, etc anything that you need to have it attached to your pc
to acomplish your daily duties. After creating the list you need to go to the hardare provider website and check if the hardware is supported by the new windows,
if they have Drivers, or see if they have a replacement that is compatible with it.
About Software, as well as Microsoft is closing Support to Windows XP, several companies will do too, like Oracle and Adobe, so create your second list
and add to it only the software that you really need, again you need to check your software provider and verify if there are new version available for the new OS.
This process should not be really painfull just be organized and the upgrading procedure will be fine and smooth.
Notes:
Keep in mind that upgrading to new OS probably will require more CPU and memory.
Based on Wikipedia, Win 7 was release on October 22, 2009, 4.5 years ago. http://en.wikipedia.org/wiki/Windows_7
DONT UPGRADE TO WINDOWS VISTA PLEASE! (it could happen)
There is a big sector that still uses Windows XP http://en.wikipedia.org/wiki/Usage_share_of_operating_systems
lunes, 7 de marzo de 2011
Imprimir un Logo en una impresora de Recibos Ithaca o compatible en el Puerto Serial o Paralelo
El hardware: Impresora Ithaca 93Plus Series 90 o cualquiera IBM compatible
Software: VS 2005 vb.net (Express deberia funcionar tambien), POSjet Color Image Converter lo pueden obtener de este link: http://transact-tech.com/tsg/90utilities.html y Printer OCX Control accesible en la misma pagina http://transact-tech.com/tsg/90utilities.html.
Esta es una tarea sencilla, solamente tenemos que tener cuidado en la configuracion del puerto serie. A continuacion los pasos.
1.- Imprimir el logo como un archivo, empleando el PosJet Color Image Converter, llamemos a este archivo C:\Logo.prn. Preste atencion en la configuracion del Puerto de Comunicacion: 9600 N 8 1 H esto es muy importante
2.- Creamos un projecto nuevo en vb.net y agregamos una referencia al COM Printer OCX Control
2.- Leer este archivo C:\Logo.prn como una lista de bytes y convertirlos a una cadena de caracteres
3.- Enviar esta cadena de caracteres al puerto serial.
aqui esta el Codigo en Vb.net
Imports POSPRINTERLib
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim result As Long
Dim posPrinterObj As POSPRINTERLib.POSPrinter
posPrinterObj = New POSPrinter()
'Open Port
'Atencion Aqui el puerto debe abrirse con los mismos parametros como se creo la imagen.
result = posPrinterObj.OpenPort("COM1", "baud=9600 parity=N data=8 stop=1")
result = posPrinterObj.SetHandshake(1)
'Read file into Byte Array
Dim strByte As Byte() = System.IO.File.ReadAllBytes("C:\Logo.prn")
Dim data As String = ""
Dim pieces As String = ""
Dim index As Integer = 0
'Take each byte in the array and convert to the character equivalent,
'Building the string data piece by piece
For index = 0 To (strByte.Length - 1)
pieces = pieces + Chr(strByte(index))
Next
data = pieces
'Send the data
result = posPrinterObj.SendString(data, data.Length)
result = posPrinterObj.ClosePort()
End Sub
End Class
Agradecimientos al departamento de soporte tecnico de Transact Technologies Inc.
http://www.transact-tech.com/tsg/technical_support.html
Software: VS 2005 vb.net (Express deberia funcionar tambien), POSjet Color Image Converter lo pueden obtener de este link: http://transact-tech.com/tsg/90utilities.html y Printer OCX Control accesible en la misma pagina http://transact-tech.com/tsg/90utilities.html.
Esta es una tarea sencilla, solamente tenemos que tener cuidado en la configuracion del puerto serie. A continuacion los pasos.
1.- Imprimir el logo como un archivo, empleando el PosJet Color Image Converter, llamemos a este archivo C:\Logo.prn. Preste atencion en la configuracion del Puerto de Comunicacion: 9600 N 8 1 H esto es muy importante
2.- Creamos un projecto nuevo en vb.net y agregamos una referencia al COM Printer OCX Control
2.- Leer este archivo C:\Logo.prn como una lista de bytes y convertirlos a una cadena de caracteres
3.- Enviar esta cadena de caracteres al puerto serial.
aqui esta el Codigo en Vb.net
Imports POSPRINTERLib
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim result As Long
Dim posPrinterObj As POSPRINTERLib.POSPrinter
posPrinterObj = New POSPrinter()
'Open Port
'Atencion Aqui el puerto debe abrirse con los mismos parametros como se creo la imagen.
result = posPrinterObj.OpenPort("COM1", "baud=9600 parity=N data=8 stop=1")
result = posPrinterObj.SetHandshake(1)
'Read file into Byte Array
Dim strByte As Byte() = System.IO.File.ReadAllBytes("C:\Logo.prn")
Dim data As String = ""
Dim pieces As String = ""
Dim index As Integer = 0
'Take each byte in the array and convert to the character equivalent,
'Building the string data piece by piece
For index = 0 To (strByte.Length - 1)
pieces = pieces + Chr(strByte(index))
Next
data = pieces
'Send the data
result = posPrinterObj.SendString(data, data.Length)
result = posPrinterObj.ClosePort()
End Sub
End Class
Agradecimientos al departamento de soporte tecnico de Transact Technologies Inc.
http://www.transact-tech.com/tsg/technical_support.html
Etiquetas:
COM1,
Imprimir,
Ithaca,
puerto serial,
Series90
miércoles, 29 de diciembre de 2010
Mini Apps - Aplicaciones Portables
Todos tenemos una Memoria USB ya sea de 512 Mb o de mayor capacidad, si eres de las personas que comparten la pc entre el hogar y el trabajo o un profesional de servicios tecnicos de computadoras las mini aplicaciones o aplicaciones portables pueden ser de mucha utilidad. Estos programas se ejecutan desde la memoria USB y no necesitan ser instaladas en el computador. Hasta ahora las he ejecutado en windows XP y Windows 7 sin ningun problema. Programas como Firefox, Open Office, Skype, etc. funcionan sin necesidad de instalar.
Otro factor importante es que puedes mantener toda tu informacion en un solo lugar en tu Memoria USB.
Aqui les dejo unos links:
http://portableapps.com/
http://www.pendriveapps.com/
http://www.portablefreeware.com/
Otro factor importante es que puedes mantener toda tu informacion en un solo lugar en tu Memoria USB.
Aqui les dejo unos links:
http://portableapps.com/
http://www.pendriveapps.com/
http://www.portablefreeware.com/
Suscribirse a:
Entradas (Atom)


















