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 

EBCDIC to HEXA in an output file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
cyber_snake
Beginner


Joined: 24 Dec 2006
Posts: 10
Topics: 1

PostPosted: Wed Feb 20, 2008 3:04 am    Post subject: EBCDIC to HEXA in an output file Reply with quote

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
View user's profile Send private message AIM Address
cyber_snake
Beginner


Joined: 24 Dec 2006
Posts: 10
Topics: 1

PostPosted: Wed Feb 20, 2008 3:06 am    Post subject: Re: EBCDIC to HEXA in an output file Reply with quote

---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
View user's profile Send private message AIM Address
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed Feb 20, 2008 7:00 am    Post subject: Reply with quote

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
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Wed Feb 20, 2008 10:58 am    Post subject: Reply with quote

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
View user's profile Send private message
cyber_snake
Beginner


Joined: 24 Dec 2006
Posts: 10
Topics: 1

PostPosted: Wed Feb 20, 2008 8:23 pm    Post subject: Reply with quote

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... Smile
Back to top
View user's profile Send private message AIM Address
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Thu Feb 21, 2008 4:59 am    Post subject: Reply with quote

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
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Thu Feb 21, 2008 10:02 am    Post subject: Reply with quote

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
View user's profile Send private message
cyber_snake
Beginner


Joined: 24 Dec 2006
Posts: 10
Topics: 1

PostPosted: Thu Feb 21, 2008 1:16 pm    Post subject: Reply with quote

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... Smile

Thanks to NIC and Bill, at least you give effort to reply my query.... thanks for your precious time... Smile
Back to top
View user's profile Send private message AIM Address
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Thu Feb 21, 2008 5:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri Feb 22, 2008 5:49 am    Post subject: Reply with quote

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
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri Feb 22, 2008 6:17 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Feb 22, 2008 12:26 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
cyber_snake
Beginner


Joined: 24 Dec 2006
Posts: 10
Topics: 1

PostPosted: Sun Feb 24, 2008 10:18 pm    Post subject: Reply with quote

Hi Kolosu,

I tried it... Thank you very much... I never thought it was simpler than this...

Thanks... again... Very Happy Laughing
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) 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