Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

I must write Macro that converting string or number toEBCDIC

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: I must write Macro that converting string or number toEBCDIC
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 11 Tue May 16, 2017 2:20 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts RC 20 for Address ISPEXEC "ISRED... pkmurali CLIST & REXX 3 Sun Apr 16, 2017 11:30 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us