View previous topic :: View next topic |
Author |
Message |
cyber_snake Beginner
Joined: 24 Dec 2006 Posts: 10 Topics: 1
|
Posted: Wed Feb 20, 2008 3:04 am Post subject: EBCDIC to HEXA in an output file |
|
|
Im encountering difficult saving the file in HEXA mode, Is there any utility or CAN I convert the EBCDIC data to a HEXA in an output file?
Example (using HEX ON) Code: |
000001 YB1233TS.0 <--- 1st record
0ECFFFFEE4F00
382123332B001
--------------------
000002 YB1233TS.0 <--- 2nd record
0ECFFFFEE4F00
382123332B001
--------------------
000003 YCHANKICU1 <--- 3rd record
0ECCCDDCCEF02
3838152934107
-------------------- |
|
|
Back to top |
|
 |
cyber_snake Beginner
Joined: 24 Dec 2006 Posts: 10 Topics: 1
|
Posted: Wed Feb 20, 2008 3:06 am Post subject: Re: EBCDIC to HEXA in an output file |
|
|
---rearrange the example data-------
Example (using HEX ON) Code: |
YB1233TS.0 <--- 1st record
0ECFFFFEE4F00
382123332B001
--------------------
YB1233TS.0 <--- 2nd record
0ECFFFFEE4F00
382123332B001
--------------------
YCHANKICU1 <--- 3rd record
0ECCCDDCCEF02
3838152934107 |
|
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Wed Feb 20, 2008 7:00 am Post subject: |
|
|
So explain how you want your output data to look like. EBCDIC is just a way of interpreting hex data, ASCII is another. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Wed Feb 20, 2008 10:58 am Post subject: |
|
|
snake,
When you type HEX ON, you see the hex values for the EBCDIC characters that ISPF displays. The data records saved in the file are the hex values shown. ISPF simply displays them as EBCDIC because it makes more sense to the end user. _________________ Regards,
Bill Dennis
Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity. |
|
Back to top |
|
 |
cyber_snake Beginner
Joined: 24 Dec 2006 Posts: 10 Topics: 1
|
Posted: Wed Feb 20, 2008 8:23 pm Post subject: |
|
|
Yes I know, but i want to save the hex value representation into an output file, can I do that using other utilities or worst I create a conversion program?
Because if I download the file in EBCDIC format into a spreadsheet, my end user told me that some account has a duplicate records but the fact that they are not duplicate if you look there hex values. I explain to them using screen shot of a hex value of an account and they agree but they want the hex value representation for the all records.
By the way, my user doesn't know how to use mainframe that's why we send them our file thru spreadsheet.
Thanks for those we reply, I really appreciate it...  |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Thu Feb 21, 2008 4:59 am Post subject: |
|
|
I do not think you are 'getting it'.
Is your end user on PC? If so your file would have been translated from EBCDIC to ASCII so you will have a different hex representation. For example: 100 in EBCDIC is x'f1f0f0', in ASCII it is x'313030'.
Now, if you want your 100 ebcdic in a 'hex form' you would have to convert it to the string 'F!F0F0' but that has a hex representation of 'C6F1C6F0C6F0' which will be different when looked at on the PC.
So, you are sending a file to a spreadsheet so it will be a text file so you will be able to look at it no problem and you should be able to compare it manually with the mainframe file which will also be a text file - yes? You know which record is being queried so you do not have to scan the whole file - just the bit being queried. You could also extract that record and send it as a complete file to the PC to check it out. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Thu Feb 21, 2008 10:02 am Post subject: |
|
|
Have you checked these duplicates? Perhaps non-displayable values are being translated to blanks on the download and that makes some records appear as duplicates?
It may not be usable in this case, but you can create a hex value output file of the entire record using IEBPTPCH: Code: | //*
//* PRINT A MEMBER IN HEX FORMAT
//*
//PRT2 EXEC PGM=IEBPTPCH
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=your.pds,DISP=SHR
//SYSUT2 DD SYSOUT=*
//SYSIN DD *
PRINT MAXNAME=1,TYPORG=PO,TOTCONV=XE
MEMBER NAME=membernm |
_________________ Regards,
Bill Dennis
Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity. |
|
Back to top |
|
 |
cyber_snake Beginner
Joined: 24 Dec 2006 Posts: 10 Topics: 1
|
Posted: Thu Feb 21, 2008 1:16 pm Post subject: |
|
|
Hi Nic, thanks for the reply, I know when you download the file in our PC it will convert it to ASCII, I only want to produce the HEX value of an account into a different column in a spreadsheet(beside the account column), to enable them(the user) to identify what are those records value in mainframe...
I think Bill gets my point... I will try that code tomorrow in my office...
Yes Bill, the duplicate value that the user said is not actually duplicate, those duplicate has a different value in HEXA(the space value has been eliminated during downloading in ASCII format), actually my end-user already know that it is not actually a duplicate... but they insist to get all the hex value of this thousand accounts records and not ideal if I done that manually... thats why I need to produce the hexa value into output as EBCDIC.
Example:
YB1233TS.0 <--- 1st record
0ECFFFFEE4F00
382123332B001
this ' YB1233TS.0 ' record become '03E8C2F1F2F3F3E3E24BF00001' in an output file.
I hope that utility will work...
Thanks to NIC and Bill, at least you give effort to reply my query.... thanks for your precious time...  |
|
Back to top |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Thu Feb 21, 2008 5:22 pm Post subject: |
|
|
I have written Assembler routines that use SHIFT and TRANSLATE to isolate each nibble (half byte) and print each byte as two hex chars. Something like that could be added as a column in the download file if you can change the program. _________________ Regards,
Bill Dennis
Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity. |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Fri Feb 22, 2008 5:49 am Post subject: |
|
|
If you are using PL/1 then you do not need to dive into assembler routines - you can just overlay half byte (4 bit) fields using arrays. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Fri Feb 22, 2008 6:17 am Post subject: |
|
|
Another way is to run your file through a rexx program and use the C2X function to convert your strings to hex
e.g.
say c2x('100')
displays '313030' on a PC and 'f1f0f0' on a mainframe _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri Feb 22, 2008 12:26 pm Post subject: |
|
|
cyber_snake,
You can use DFSORT to convert the records in hex format. The following JCL will give you the desired results.
Code: |
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
YB1233TS.0
YCHANKICU1
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC BUILD=(01,10,HEX)
/*
|
Hope this helps...
Cheers _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
cyber_snake Beginner
Joined: 24 Dec 2006 Posts: 10 Topics: 1
|
Posted: Sun Feb 24, 2008 10:18 pm Post subject: |
|
|
Hi Kolosu,
I tried it... Thank you very much... I never thought it was simpler than this...
Thanks... again...  |
|
Back to top |
|
 |
|
|