IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to convert text to hexadecimal format.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vardhan0007

New User


Joined: 05 Jun 2006
Posts: 51
Location: Bangalore,India

PostPosted: Thu May 06, 2010 10:50 am
Reply with quote

Hi D.sch,

I am changing because while posting the entire data into a table that enter key not getting posted into table. So if can replace X'0A' with some other value and post it to table perl will recognize.

-Harsha
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu May 06, 2010 8:00 pm
Reply with quote

Hello,

Why can the perl script not detect and act on the x'0A' (which is octal "012")?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu May 06, 2010 8:43 pm
Reply with quote

vardhan0007 wrote:
Hi D.sch,

I am changing because while posting the entire data into a table that enter key not getting posted into table.
-Harsha


Why is it not getting posted to the table?
Back to top
View user's profile Send private message
vardhan0007

New User


Joined: 05 Jun 2006
Posts: 51
Location: Bangalore,India

PostPosted: Fri May 07, 2010 10:19 am
Reply with quote

Hi D.sch,

The text is being inserted into a table and again from table we are writing into a falt file and in file if see there is not enter key trapped hence perl is unable act on enter key.

Hi Crag,

The table is a oracle table I am not sure why its unable to show us the enter key in the text.

Thanks,
Harsha
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Fri May 07, 2010 12:00 pm
Reply with quote

Sorry to say you have kept confusing everybody with your replies.
If you want to replace one character by another one character, that is one thing.
If you want to replace one character by a word (2 or 3 characters), that is another thing.

vardhan0007 wrote:
Hi Ronald,

Please confirm whether I can directly inspect the 1000 byte field as u said in ur post and replace with some word which I like.


If you don't believe the expert advice, then you have 2 choices:
1. Try by yourself.
2. Go to another Forum.

Now, about which character to use:
Stop using strange values, like X'2B' or X'AA', which are not displayable.
Stop using standard characters, like C'2B', which could be misunderstood as part of the text.
Use only '|'. This is the best option, as it is sometimes used as a separator.

Code:
INSPECT YOUR-VAR REPLACING ALL X'0A' BY '|'


The correct answer has already been provided. This should be the last reply in this thread.
Back to top
View user's profile Send private message
vardhan0007

New User


Joined: 05 Jun 2006
Posts: 51
Location: Bangalore,India

PostPosted: Fri May 07, 2010 12:12 pm
Reply with quote

Hello Marso,

If you don't believe the expert advice, then you have 2 choices:
1. Try by yourself.
2. Go to another Forum.


I just asked for the confirmation it doesn't mean that i dont believe. I really dont know why you are so aggressive?

Regarding your proposed solution, I exactly did what you proposed but again in table I am seeing some special character instead of |.

Thanks for your suggession.

Harsha
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri May 07, 2010 12:20 pm
Reply with quote

Quote:
I really dont know why you are so aggressive?

24 post without You being able to describe clearly the environment and the issue!
isn' t that a good reason icon_question.gif icon_evil.gif

and now You complain that You have other <strange> characters

post exactly and clearly the data flow and the issues You are facing...
for example ...
the origin of the data
how the data is being processed ( You talk about perl ??? )
how the data is transfered
and so on

and You will see that people will be less aggressive icon_cool.gif

strong suggestion...
review the application specifications in order to provide proper translation between ...
different character sets/code pages
different record formats ( record VS stream and stream VS record )
if it had been done from the beginning we would not be here wasting time
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri May 07, 2010 1:25 pm
Reply with quote

vardhan0007 wrote:
but again in table I am seeing some special character instead of |.
Is it getting time for somebody to file this thread into the recycle bin?
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Fri May 07, 2010 1:59 pm
Reply with quote

vardhan0007 wrote:
If you don't believe the expert advice, then you have 2 choices:
1. Try by yourself.
2. Go to another Forum.

I just asked for the confirmation it doesn't mean that i dont believe. I really dont know why you are so aggressive?
Usually I'm not (aggressive). And note that choice 1 is by all means non-aggressive. Note too that I gave a positive advice.

Bring your string into edit, do a FIND P'.' and a HEX ON. Write down all hex values and modify your INSPECT accordingly.
Check your program: are you storing the replaced string or the original one ??
Back to top
View user's profile Send private message
vardhan0007

New User


Joined: 05 Jun 2006
Posts: 51
Location: Bangalore,India

PostPosted: Fri May 07, 2010 3:57 pm
Reply with quote

Thanks to you all fro the replies. Now the problem is fixed.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri May 07, 2010 4:17 pm
Reply with quote

vardhan0007 wrote:
Thanks to you all fro the replies. Now the problem is fixed.
How, inquiring minds want to know....
Back to top
View user's profile Send private message
vardhan0007

New User


Joined: 05 Jun 2006
Posts: 51
Location: Bangalore,India

PostPosted: Fri May 07, 2010 4:36 pm
Reply with quote

INSPECT WS-TEXT REPLACING ALL X'0A' WITH '}'

So that } will get inserted into database and again they download the data into flat file. A perl script will pick that file and will recognize } and will treat } as carriage return and form paragraphs.

Thanks,
Harsha
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts InfoSphere OPTIM CSV ouput vs DSNTIUA... IBM Tools 3
Search our Forums:

Back to Top