Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to translate Hex data to EBCDIC in an AS/400 COBOL Program

Posted on 2002-04-17
19
Medium Priority
?
1,997 Views
Last Modified: 2012-06-27
I am working on converting a Unisys COBOL program to the AS/400 platform.  The program examines EBCDIC data.  The data coming into the file was defined as Hex externally but, was translated to EBCDIC using the Unisys COBOL statement:  CHANGE ATTRIBUTE INTMODE OF file TO EBCDIC.
How can I do this in AS/400?  Many thanks!
0
Comment
Question by:reeze
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 6
  • 2
  • +2
19 Comments
 
LVL 2

Expert Comment

by:mmcmillen
ID: 6948241
I guess I dont understand what you are trying to convert. You say the hex files were converted using the change attribute command. What are you trying to convert?  

 

0
 

Author Comment

by:reeze
ID: 6948817
I'm trying to convert HEX data into EBCDIC data. The data is coming off of tape and is in HEX format. Is there a way to convert the HEX data to EBCDIC in an AS/400 Cobol program?
0
 
LVL 2

Expert Comment

by:mmcmillen
ID: 6948867
what does the convert command that you listed do?
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

Author Comment

by:reeze
ID: 6948879
the following Unisys Cobol command will actually convert the HEX data into EBCDIC.

CHANGE ATTRIBUTE INTMODE OF file TO EBCDIC

This command changes the file attribute INTMODE (internal data mode.... how the program sees the data) to EBCDIC.

BTW  I really appreciate your help!!
0
 
LVL 2

Expert Comment

by:mmcmillen
ID: 6948887
what does the convert command that you listed do?
0
 
LVL 2

Expert Comment

by:mmcmillen
ID: 6948889
Can you ftp the file from one system to another?  Is this a lot of files and programs or just a few?
0
 
LVL 1

Accepted Solution

by:
MN_Dave earned 300 total points
ID: 6949216
So this tape contains data that you are trying to copy to the AS400?  What exactly do you mean by "Hex".  Data on the AS400 is stored in Hex and translated according to EBCDIC.  The Hex value of "A" in EBCDIC is different than the Hex value of "A" in ASCII for example.  Previously mmcmillen asked about ftping the file.  Is this a possibility?  I ftp ASCII text files from my PC to the AS400 all the time and let the AS400 convert from ASCII to EBCDIC as it loads the file.  If you can do this then you don't have to worry about converting at all.
0
 
LVL 2

Expert Comment

by:mmcmillen
ID: 6950396
My only concern with doing it one file at a time is if its a total system you are converting.  If its just a program and a few files then transfering to a pc file of some sort , then to the AS400 is a breeze.  Do you have Client Access with data transferoptions installed?
0
 

Author Comment

by:reeze
ID: 6950415
Below is a sample of the data I am talking about. The tape data was ftped onto the AS/400 (binary). I really don't know much about the ftp process. Someone else ftp-ed the data.  This is a sample of the data from the DSPPFM command. The 1st line shows the data in HEX. The 2nd + 3rd lines are the EBCDIC representation of the data in line 1.
The program that I'm converting actually works with the EBCDIC data. For example to find out that it is working with the telephone switch PHLSNY (see 1st line of data)  it examines position 3- 22 and compares it to 'D7C8D3E2D5E8F5F2F8F9'.  Sample data from DSPPFM below.

   PHLSNY52890¹Èß-èÂmîÉÅÎ
   1DCDEDEFFFFF00D71000000000051326356957637
   17832585289005A41101226000093070142461786

Many, many thanx 4 taking the time to help me!
0
 

Author Comment

by:reeze
ID: 6950435
I am only working with one file and it has been ftped onto the as/400 already. Perhaps it wasn't ftp-ed in a manner that it should have been. It was ftped binary. Sorry if I sound so lame in regards to the FTP process. I'll find more out about it 2day.  When I look at the data on the 400 using the DSPPFM command I can see the data in EBCDIC when I use the F10 option to display in HEX.  So, the data appears to be on the 400 ok.  I just don't know how to get the COBOL program to read it in the correct Format (what I see when I hit the F10 key on the DSPPFM) format.
0
 
LVL 2

Expert Comment

by:mmcmillen
ID: 6950456
My only concern with doing it one file at a time is if its a total system you are converting.  If its just a program and a few files then transfering to a pc file of some sort , then to the AS400 is a breeze.  Do you have Client Access with data transferoptions installed?
0
 
LVL 2

Assisted Solution

by:mmcmillen
mmcmillen earned 300 total points
ID: 6950472
I have no idea why my posts are duplicated.  I don't know Cobol/400.   I am an rpg programmer.  Have you tried to read the file with the program on the as400? What happens?

I'd suggest writing a quick program to read a record and write it to a report.  The translation i would think would be automatic.
0
 

Author Comment

by:reeze
ID: 6950498
That's a great idea - read a record and write it to a report. Wish me luck.  
0
 
LVL 2

Expert Comment

by:mmcmillen
ID: 6962745
Hows it working?
0
 

Author Comment

by:reeze
ID: 6969236
Just to let you know,  I enlisted the help of an RPG programmer in our shop. He had a routine that would accept an input parameter that was packed data and then send back to the calling routine the HEX representation (in charachter format) so that it could be manipulated by the COBOL program.  We used ILE CBL and RPG to bind these programs together.  It's working now.  Yeah.  I really appreciate the time that you gave (Dave and mmcmillen) to helping me resolve this issues.
0
 
LVL 3

Expert Comment

by:P_S_Price
ID: 7149050
Reez, Could I just add one comment!! I suspect that the reason that the EBCDIC code translation was used in the first place in your UNISYS program is because you were getting data supplied from an IBM machine.

You are aware arent you that OS/400 is an EBCDIC operating system?
0
 
LVL 33

Expert Comment

by:shalomc
ID: 8961843
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ/Refund

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

ShalomC
EE Cleanup Volunteer
0
 
LVL 2

Expert Comment

by:mmcmillen
ID: 8963746
I think MN_dave and I should split the points
0
 
LVL 33

Expert Comment

by:shalomc
ID: 8965439
mmcmillen,

Since the asker did say "...I really appreciate the time that you gave (Dave and mmcmillen) to helping me resolve this issues. ", I'll change the recommendation to Split between mmcmillen and MN_Dave


ShalomC
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question