MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Assembler to COBOL conversion

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
rnanavaty
Beginner


Joined: 12 Apr 2006
Posts: 29
Topics: 20

PostPosted: Tue Mar 20, 2007 7:04 am    Post subject: Assembler to COBOL conversion Reply with quote

We are converting one of our project module from assembly to cobol. In assembly we have

1) Files which contains hexadecimal values like 'F0045AD....'
2)AND and OR operation on bits are present

How to deal with them? If any one of you came across such type of assignment, please provide your valuable suggestions.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Mar 20, 2007 9:36 am    Post subject: Reply with quote

rnanavaty,



1. what about the hex values? You can read them like any normal file reading.

2. Cobol supports bit testing. You have 4 language enviroment calls which can used for bit testing. Check this link

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/CEEA3130/4.0?DT=20020625092930

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Tue Mar 20, 2007 12:44 pm    Post subject: Reply with quote

Kolusu,

Can you please share any sample examples if you can about usage of Bit Operators in COBOL ?
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Tue Mar 20, 2007 3:34 pm    Post subject: Reply with quote

Why not just search Google for CEESITST? It turns up lots of examples.
Back to top
View user's profile Send private message Visit poster's website
rnanavaty
Beginner


Joined: 12 Apr 2006
Posts: 29
Topics: 20

PostPosted: Wed Mar 21, 2007 1:46 am    Post subject: Reply with quote

Thanx for your Input Kolusu. Bit handling is clear now.

But still I am not very clear about handling hex values in COBOL. If a physical seq. file contains 'FA1023......' as emp no. and salary for example then do we need to write a seprate program to convert those values or we can directly use this file????
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Mar 21, 2007 7:13 am    Post subject: Reply with quote

rnanavaty,

Is your input in hex if so search this forum for converting hex into character using cobol

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Fri Mar 23, 2007 8:38 am    Post subject: Reply with quote

One of the hardest things to tackle in Assembler is the hex "part". Is a given hex string really data ? Or, an address location ?

Also, rnanavaty, you want to handle HEX data in COBOL. What is NOT hex on mainframe or on any other computer ? If you saw a hex string in a EBCDIC file as X'C3C1E3' would you call it hex data when it is actually just the string 'CAT' ?
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
rnanavaty
Beginner


Joined: 12 Apr 2006
Posts: 29
Topics: 20

PostPosted: Fri Mar 30, 2007 5:43 am    Post subject: Reply with quote

Yes Cogito-Ergo-Sum
You are correct but we are involved in an RE-engineering type of project. So as I know that we can have have value equivalent to HEX string but the question is " Do we need to write routine to convert any PS file from hex to EBCDIC or we can directly use use that file in cobol????????"
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Fri Mar 30, 2007 6:48 am    Post subject: Reply with quote

I repeat.
Quote:
If you saw a hex string in a EBCDIC file as X'C3C1E3' would you call it hex data when it is actually just the string 'CAT' ?


If this is still not clear, let us know the sample input and output you expect.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Fri Mar 30, 2007 7:00 am    Post subject: Reply with quote

hex refers to the base 16 number system (0-F). EBCDIC and ASCII are code schemes used to organize all the different print or graphic chars by hex values. you need to determine what the reference by the assembler program to 'hex' values means. Maybe the asm pgm is indexing thru all the char in the input file string.

more than likely, these are not acsii encoded files. I would go thru the dsect used to define the input-file and determine how you have to map your cobol record definition. Based on what the asm module handles each file, you can determine if it is char, numeric - and if packed-decimal, binary or display, or a table counter or a pointer of some type.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group