Page 1 of 1

Converting ASCII to EBCDIC using ALTSEQ

PostPosted: Tue Jun 08, 2010 2:55 pm
by rulerofera
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.

Re: Converting ASCII to EBCDIC using ALTSEQ

PostPosted: Tue Jun 08, 2010 8:14 pm
by MrSpock
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?

Re: Converting ASCII to EBCDIC using ALTSEQ

PostPosted: Wed Jun 09, 2010 12:10 am
by dick scherrer
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. . . :?

Re: Converting ASCII to EBCDIC using ALTSEQ

PostPosted: Wed Jun 09, 2010 1:43 pm
by rulerofera
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.

Re: Converting ASCII to EBCDIC using ALTSEQ

PostPosted: Wed Jun 09, 2010 4:58 pm
by Robert Sample
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.

Re: Converting ASCII to EBCDIC using ALTSEQ

PostPosted: Tue Oct 26, 2010 3:07 am
by Frank Yaeger
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