PC Review


Reply
Thread Tools Rate Thread

Cobol to .Net

 
 
Mythran
Guest
Posts: n/a
 
      24th Mar 2005
No Cobol.Net yet? Wha?!?

Anywho, hope someone is familiar enough with Cobol to help me out here. I
have some files written by COBOL applications that contain COMP-3 fields (on
a mainframe) that I ftp up to a network folder for processing in .Net.
Anyone know if it's possible (and how) to convert those COMP-3 (PIC S9(5)V99
COMP-3, for example) to a numeric of type double/single/et cetera?

Hope so, as of now, I'm writing all the fix-it cob programs to convert on
the mainframe before the ftp. If there is a .Net solution, that would be so
much easier.

Thanks,

Mythran


 
Reply With Quote
 
 
 
 
Frank Rizzo
Guest
Posts: n/a
 
      24th Mar 2005
Mythran wrote:
> No Cobol.Net yet? Wha?!?
>
> Anywho, hope someone is familiar enough with Cobol to help me out here. I
> have some files written by COBOL applications that contain COMP-3 fields (on
> a mainframe) that I ftp up to a network folder for processing in .Net.
> Anyone know if it's possible (and how) to convert those COMP-3 (PIC S9(5)V99
> COMP-3, for example) to a numeric of type double/single/et cetera?
>
> Hope so, as of now, I'm writing all the fix-it cob programs to convert on
> the mainframe before the ftp. If there is a .Net solution, that would be so
> much easier.


There is, though I don't really know anything about it.
http://www.apress.com/book/bookDisplay.html?bID=112



>
> Thanks,
>
> Mythran
>
>

 
Reply With Quote
 
John J. Hughes II
Guest
Posts: n/a
 
      24th Mar 2005
Never used it and it's been many moons since I used COBOL bu there is Tiny
Cobol on source forge. It might contian some functions for conveting the
COMP-3 fields.

http://tiny-cobol.sourceforge.net/index.php

regards,
John


"Mythran" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> No Cobol.Net yet? Wha?!?
>
> Anywho, hope someone is familiar enough with Cobol to help me out here. I
> have some files written by COBOL applications that contain COMP-3 fields
> (on a mainframe) that I ftp up to a network folder for processing in .Net.
> Anyone know if it's possible (and how) to convert those COMP-3 (PIC
> S9(5)V99 COMP-3, for example) to a numeric of type double/single/et
> cetera?
>
> Hope so, as of now, I'm writing all the fix-it cob programs to convert on
> the mainframe before the ftp. If there is a .Net solution, that would be
> so much easier.
>
> Thanks,
>
> Mythran
>
>



 
Reply With Quote
 
Brian Henry
Guest
Posts: n/a
 
      24th Mar 2005
there is COBOL.NET its made by Fujitsu


"Frank Rizzo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Mythran wrote:
>> No Cobol.Net yet? Wha?!?
>>
>> Anywho, hope someone is familiar enough with Cobol to help me out here.
>> I have some files written by COBOL applications that contain COMP-3
>> fields (on a mainframe) that I ftp up to a network folder for processing
>> in .Net. Anyone know if it's possible (and how) to convert those COMP-3
>> (PIC S9(5)V99 COMP-3, for example) to a numeric of type double/single/et
>> cetera?
>>
>> Hope so, as of now, I'm writing all the fix-it cob programs to convert on
>> the mainframe before the ftp. If there is a .Net solution, that would be
>> so much easier.

>
> There is, though I don't really know anything about it.
> http://www.apress.com/book/bookDisplay.html?bID=112
>
>
>
>>
>> Thanks,
>>
>> Mythran
>>


 
Reply With Quote
 
Alejandro Lapeyre
Guest
Posts: n/a
 
      24th Mar 2005
Here there is a good description of the COMP-3 fields:
http://www.discinterchange.com/TechT...d_fields_.html

It looks like it is a "packed" decimal representation: every byte contains
two decimal digits. The last byte contains the sign.

An unchecked function to convert a buffer may be this:
(Note that OutlookExpress does not compile this :-))

function PackedToDecimal(buffer() as byte) as decimal
dim result as decimal = 0
dim i as integer
dim b as byte
for i = 0 to buffer.length - 2
b = buffer(i)
result += (b and (&HF)) + ((b >> 4) * 10)
next
b = buffer(i)
r +=((b >> 4) * 10)
dim s as byte = (b and &HF)
if s = &HD Then
result = -result
end if
return r
end function

You will have to divide the result if it contains decimal digits.


Best Regards,
Alejandro Lapeyre

"Mythran" <(E-Mail Removed)> escribió en el mensaje
news:%(E-Mail Removed)...
> No Cobol.Net yet? Wha?!?
>
> Anywho, hope someone is familiar enough with Cobol to help me out here. I
> have some files written by COBOL applications that contain COMP-3 fields
> (on a mainframe) that I ftp up to a network folder for processing in .Net.
> Anyone know if it's possible (and how) to convert those COMP-3 (PIC
> S9(5)V99 COMP-3, for example) to a numeric of type double/single/et
> cetera?
>
> Hope so, as of now, I'm writing all the fix-it cob programs to convert on
> the mainframe before the ftp. If there is a .Net solution, that would be
> so much easier.
>
> Thanks,
>
> Mythran
>
>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      25th Mar 2005
Mythran,

As far as I remember me is for you problem that every cobol compiler can use
other formats for Comp-3

It depends on the platform the program is compiled for. By instance the
sample you saw is as far as I remember me typical for IBM EBCDIC platforms.

However although a lot of people are thinking that, is not the only platform
where Cobol is used. There where at least two developments of Cobol used on
the PC's, which are sold by different vendors and have got the names from
those vendors. Because of the fact that the PC does not use EBCDIC you can
understand that the format on that alone because that is not the same as on
an IBM computer.

Therefore I would in your situation investigate what format is made. With
first starting on what platform the Cobol is used.

Not much, however I hope it helps,

Cor


 
Reply With Quote
 
Mythran
Guest
Posts: n/a
 
      25th Mar 2005

"Cor Ligthert" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Mythran,
>
> As far as I remember me is for you problem that every cobol compiler can
> use other formats for Comp-3
>
> It depends on the platform the program is compiled for. By instance the
> sample you saw is as far as I remember me typical for IBM EBCDIC
> platforms.
>
> However although a lot of people are thinking that, is not the only
> platform where Cobol is used. There where at least two developments of
> Cobol used on the PC's, which are sold by different vendors and have got
> the names from those vendors. Because of the fact that the PC does not use
> EBCDIC you can understand that the format on that alone because that is
> not the same as on an IBM computer.
>
> Therefore I would in your situation investigate what format is made. With
> first starting on what platform the Cobol is used.
>
> Not much, however I hope it helps,
>
> Cor
>


Yeah, I understand. We have found a way to convert by sending the file from
the mainframe to the network folder via ftp in binary mode. That gives us a
binary format in ebcdic. Now I can manually uncompress all fields that are
packed and then convert all numeric data and then convert the text (not
including controls characters). This will give us what we need. So, just
gotta create the .Net assemblies for doing this

Thanks for everyone's insights.

Mythran


 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      25th Mar 2005
Mythran,

I don't if it helps, however in this newsgroup has in my opinion Jay given
the most complete answer on your question now I know it is EBCDIC. I give
you the full thread because there is more interesting in that.

http://groups-beta.google.com/group/...bbc3c3c7ffac33

You never know how it helps,

Cor


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
COBOL Help Joydeep Chakrabarty Microsoft Access 1 15th Feb 2009 05:54 PM
Cobol to c# horus555 Webmaster / Programming 0 15th Jun 2005 06:49 PM
Cobol to .Net Mythran Microsoft C# .NET 7 25th Mar 2005 05:21 PM
cobol.net =?Utf-8?B?S0xvbWF4?= Microsoft Dot NET 2 23rd Aug 2004 04:49 AM
Cobol and XP Felipe Santana Windows XP General 1 17th Sep 2003 09:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:53 PM.