Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

To read hexadecimal data in char type field with RPG400

Status
Not open for further replies.

francoisf

Programmer
Feb 11, 2004
30
0
0
FR
Hi,
i try to read a field define as character in DDS, but containing hexadecimal data (i can't see those data using QRY or DSPPFM command, i just can see * or _ caracters).

Is it possible to do it with a RPG400 program ?

If it isn't, how can i be sure that my system is ok to compile RPG ILE programs (i tryed, but i got the message : CALLB cannot be used when DFTACTGRP(*YES) is specified, i try to find the CVTCH program, but i didn't..)

Thanks in advance !
 
DSPPFM, then F10, then F11. You will see the file contents and the hex representation right below it:
Code:
*...+....1....+....2....+....3..
 NONE                          A
4DDDC44444444444444444444444444C
05655000000000000000000000000001


"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci

 
Thank you for your answer, but i have to read those data with a rpg400 program...
If you know a way to do it...
Thanks in advance !
 
Sorry, when I cut and pasted, it left out a space at the beginning of the second line - it should be

' NONE A'



"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci

 
did you read my answer in thread317-784726?


"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci

 
i don't know how to get the id of a thread, but the only thread i read was telling me to use DSPPFM command, and then F10 and F11.

I know that is a way to see the contents of a file, but i have to read those data by rpg400 program because i have to use it to calculate something.
The read have to be automatically done by the program, to be runned by a user..

Thanks if you can help me !
 
That's what I was showing you how to do. There is a link to a Google newsgroup thread which will show you how to use the cvthc and cvtch function in the C++ runtime library to do exactly what you want.

Click on this ===>> Thread317-784726

and paste the long URL you find in there into your browser.




"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci

 
i read it, but it's only a way to convert hexadecimal data using RPG IV or RPG ILE..I don't know this language, i only use RPG400..

I don't know if my system is able to create RPG ILE or RPG IV programs..and i don' know how to know it.

Thank you very much !
 
You do have to write it in RPG IV, but it doesn't have to be an ILE program. You can compile it with the CRTBNDRPG command.

Now is the time to learn RPG IV and ILE..




"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci

 
Why don't you try this,,, go old school, and using the F and I spec, define the file, and do not use the DDS definition. That way you can define the fields they way you need to. Also you would need to use the CL OVRDBF command, to make sure you get what you need. You know of course,, while reading your post one thought has occured to me. If you are get Packed Decimal Data, in a character location, then somewhere you have the same thing happening in reverse. Somewhere you have a program using F and O specs, and writing packed data to a character location.
 
Thank you for your answer,
i found this way :

this is the data i have to read (when i see it by DSPPFM):

001000000001
00F00F00F00F

this is what i put in my RPG400 program:

FMYFILE IP E K DISK
I DS
I 1 12 CHAR
I P 1 30dec1
I P 4 60dec2
I P 7 90dec3
I P 10 120dec4
C MOVELFILEFLD CHAR

That way i can calculate with dec1,dec2..etc..



 
I think its finally the right method. I would have used the same.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top