Converting ASCII to EBCDIC using ALTSEQ



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Converting ASCII to EBCDIC using ALTSEQ

Postby rulerofera » Tue Jun 08, 2010 2:55 pm

Hello,

Can we convert an ASCII character to EBCIDIC char using ALTSEQ code table ?

like for e.g:
ALTSEQ CODE=(0000,0101,0202,0303,0437,052D,062E,072F)
OUTREC FIELDS=(1,80,TRAN=ALTSEQ)

I did tries this but what it essentially doing is converting an ASCII to ASCII.
What more need sto be done, to make it work for ASCII to EBCDIC converison.
Thanks.
rulerofera
 
Posts: 2
Joined: Tue Jun 08, 2010 2:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Converting ASCII to EBCDIC using ALTSEQ

Postby MrSpock » Tue Jun 08, 2010 8:14 pm

Wouldn't it be easier to use one of the IBM-supplied character conversion utilities, such as OCOPY or OGET, rather than trying to do the same process from scratch?
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Converting ASCII to EBCDIC using ALTSEQ

Postby dick scherrer » Wed Jun 09, 2010 12:10 am

Hello,

How did this ascii data get onto the mainframe?

Usually, ascii data is converted to ebcdic as part of the transfer to the mainframe. . . :?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Converting ASCII to EBCDIC using ALTSEQ

Postby rulerofera » Wed Jun 09, 2010 1:43 pm

Hey Dick, you know what, I was wondering exactly that, if we get any file from UNIX box to Mainframe through FTP will data on file be automatically converted to EBCDIC format. Is there any way to confirm this, like comparing a particular character on unix box and then on the dataset that we got through FTP. Thanks


Hey Spock, I didn't knew about ocopy, oget, I am researching this topic. Thanks for the pointer. Btw, if you might have used these commands earlier, coudl you please help me with some sample code. Thanks.
rulerofera
 
Posts: 2
Joined: Tue Jun 08, 2010 2:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Converting ASCII to EBCDIC using ALTSEQ

Postby Robert Sample » Wed Jun 09, 2010 4:58 pm

Is there any way to confirm this, like comparing a particular character on unix box and then on the dataset that we got through FTP.
You can manually inspect the records of the file to see if they have recognizable text in them. If there is recognizable text, the conversion occurred.

File transfers can be either binary or text. A binary transfer sends the data just as it is to the other machine -- in which case ASCII on the Unix box would remain ASCII on the mainframe. A text transfer automatically converts ASCII to EBCDIC (or, possibly, another code page).

One key point to remember is that ASCII and EBCDIC have the same collating sequence (for the first 128 characters, at least, and for all 256 if dealing with extended ASCII). There is therefore no automated way to determine if a given file is EBCDIC or ASCII. For example, take the hexadecimal string '97994D'. This may be an EBCDIC packed decimal (COMP-3 in COBOL) field of -97994. However, it also represent 'pr(' if treated as characters. Which is it? Only the application documentation can tell you for sure. If you see a batch of hex '20' characters the file is probably ASCII whereas a batch of hex '40' characters would probably indicate the file is EBCDIC. But that is not a guarantee.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Converting ASCII to EBCDIC using ALTSEQ

Postby Frank Yaeger » Tue Oct 26, 2010 3:07 am

Can we convert an ASCII character to EBCIDIC char using ALTSEQ code table ?

like for e.g:
ALTSEQ CODE=(0000,0101,0202,0303,0437,052D,062E,072F)
OUTREC FIELDS=(1,80,TRAN=ALTSEQ)

I did tries this but what it essentially doing is converting an ASCII to ASCII.
What more need sto be done, to make it work for ASCII to EBCDIC converison.


With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct,2010), you can use DFSORT's new TRAN=ATOE function to convert ASCII to EBCDIC, e.g.

   OPTION COPY
   OUTREC BUILD=(1,80,TRAN=ATOE)


For complete details on the new functions for DFSORT and DFSORT's ICETOOL available with the Oct, 2010 PTF, see:

http://www.ibm.com/support/docview.wss? ... g3T7000242
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post