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

I must write Macro that converting string or number toEBCDIC


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
evgenik

New User


Joined: 30 Aug 2006
Posts: 1

PostPosted: Thu Oct 26, 2006 5:02 am
Reply with quote

Hi. I am beginner in Assembler (only 1.5 month) and don't know much in Assembler coding.
I must write Macro that converting character string or number to it EBCDIC values. The

Macro receive two parameters: Input (Parameter - number or string), Output (EBCDIC value).

Send: 'ABC', receive: 'C1C2C3' or send '123' , receive: 'F1F2F3'.
Could anyone tell me how to convert a character string or a number to its EBCDIC values.

Help me, please.

Regards, Evgeni.
Back to top
View user's profile Send private message
TizMe

New User


Joined: 05 Jan 2006
Posts: 72

PostPosted: Fri Oct 27, 2006 11:02 am
Reply with quote

Here is a translation table to go both ways. Use the " TR " command.
Quote:

******** TRANSLATE TABLE -- FROM EBCDIC TO ASCII
SPACE 1
EBCTOASC EQU *
DC X'000102031A091A7F1A1A1A0B0C0D0E0F'
DC X'101112131A0A081A18191A1A1C1D1E1F'
DC X'1A1A1C1A1A0A171B1A1A1A1A1A050607'
DC X'1A1A161A1A1E1A041A1A1A1A14151A1A'
DC X'20A6E180EB909FE2AB8B9B2E3C282B7C'
DC X'26A9AA9CDBA599E3A89E21242A293B5E'
DC X'2D2FDFDC9ADDDE989DACBA2C255F3E3F'
DC X'D78894B0B1B2FCD6FB603A2340273D22'
DC X'F861626364656667686996A4F3AFAEC5'
DC X'8C6A6B6C6D6E6F7071729787CE93F1FE'
DC X'C87E737475767778797AEFC0DA5BF2F9'
DC X'B5B6FDB7B8B9E6BBBCBD8DD9BF5DD8C4'
DC X'7B414243444546474849CBCABEE8ECED'
DC X'7D4A4B4C4D4E4F505152A1ADF5F4A38F'
DC X'5CE7535455565758595AA0858EE9E4D1'
DC X'30313233343536373839B3F7F0FAA7FF'
SPACE 1
******** TRANSLATE TABLE -- FROM ASCII TO EBCDIC
SPACE 1
ASCTOEBC EQU *
DC X'00010203372D2E2F1605250B0C0D0E0F'
DC X'101112133C3D322618193F27221D351F'
DC X'405A7F7B5B6C507D4D5D5C4E6B604B61'
DC X'F0F1F2F3F4F5F6F7F8F97A5E4C7E6E6F'
DC X'7CC1C2C3C4C5C6C7C8C9D1D2D3D4D5D6'
DC X'D7D8D9E2E3E4E5E6E7E8E9ADE0BD5F6D'
DC X'79818283848586878889919293949596'
DC X'979899A2A3A4A5A6A7A8A9C04FD0A107'
DC 128X'00'
Back to top
View user's profile Send private message
bengtpelle

New User


Joined: 28 Aug 2006
Posts: 24
Location: St. Petersburg, FL

PostPosted: Mon Oct 30, 2006 12:20 am
Reply with quote

Code:
INPUT DC C'ABC'
DUMMY DC C' '
OUTPUT DC CL6' '
DUMMYO DC C' '
TRTAB    DC C'0123456789ABCDEF'

          UNPK DUMMYO(7),INPUT(4)   NOTE USE ONE MORE CHAR
          TR     DUMMYO(6),TRTAB-240
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 -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
Search our Forums:

Back to Top