🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: bit.listserv.tsorexx
10 messages
10 total messages Started by Ward Able, Grant Tue, 12 Mar 2013 14:59
converting from ASCII to EBCDIC
#265
Author: Ward Able, Grant
Date: Tue, 12 Mar 2013 14:59
63 lines
2606 bytes
Hi REXXers,



I need to read a file that resides in an USS directory and search for some text. However the data in the file in in ASCII format. I have done some searching but am not able to discover a method of converting the data. I am pretty sure that this must have been done a number of times by the members of this list, so can someone please give me a pointer to some document that I can read up on it?



I have tried reading it, but all I get is: "?? _%?     ?>??????? > ?  > ??   ???????  ? (   % ? _%> ?  ??  >?     ? >%?> ?  "





 

Regards - Grant





Grant Ward Able

Senior Systems Architect

Transaction and Messaging Technologies

DTCC London

gwardable@dtcc.com

Phone 0207 650 1496







<BR>_____________________________________________________________

<FONT size=2><BR>

DTCC DISCLAIMER: This email and any files transmitted with it are

confidential and intended solely for the use of the individual or

entity to whom they are addressed. If you have received this email

in error, please notify us immediately and delete the email and any

attachments from your system. The recipient should check this email

and any attachments for the presence of viruses.  The company

accepts no liability for any damage caused by any virus transmitted

by this email.</FONT>

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX
Re: converting from ASCII to EBCDIC
#266
Author: Ted MacNEIL
Date: Tue, 12 Mar 2013 15:03
48 lines
3023 bytes
OCOPY
-
Ted MacNEIL
eamacneil@yahoo.ca
Twitter: @TedMacNEIL

-----Original Message-----
From: "Ward Able, Grant" <GWardable@DTCC.COM>
Sender: TSO REXX Discussion List <TSO-REXX@VM.MARIST.EDU>
Date:         Tue, 12 Mar 2013 14:59:09 
To: <TSO-REXX@VM.MARIST.EDU>
Reply-To: TSO REXX Discussion List <TSO-REXX@VM.MARIST.EDU>
Subject: [TSO-REXX] converting from ASCII to EBCDIC

Hi REXXers,

I need to read a file that resides in an USS directory and search for some text. However the data in the file in in ASCII format. I have done some searching but am not able to discover a method of converting the data. I am pretty sure that this must have been done a number of times by the members of this list, so can someone please give me a pointer to some document that I can read up on it?

I have tried reading it, but all I get is: "?? _%?     ?>??????? > ?  > ??   ???????  ? (   % ? _%> ?  ??  >?     ? >%?> ?  "


 
Regards - Grant


Grant Ward Able
Senior Systems Architect
Transaction and Messaging Technologies
DTCC London
gwardable@dtcc.com
Phone 0207 650 1496



<BR>_____________________________________________________________
<FONT size=2><BR>
DTCC DISCLAIMER: This email and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom they are addressed. If you have received this email
in error, please notify us immediately and delete the email and any
attachments from your system. The recipient should check this email
and any attachments for the presence of viruses.  The company
accepts no liability for any damage caused by any virus transmitted
by this email.</FONT>

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX
Re: converting from ASCII to EBCDIC
#267
Author: Steve Comstock
Date: Tue, 12 Mar 2013 15:15
58 lines
3110 bytes
On 3/12/2013 8:59 AM, Ward Able, Grant wrote:
> Hi REXXers,
>
> I need to read a file that resides in an USS directory and search for some text. However the data in the file in in ASCII format. I have done some searching but am not able to discover a method of converting the data. I am pretty sure that this must have been done a number of times by the members of this list, so can someone please give me a pointer to some document that I can read up on it?
>
> I have tried reading it, but all I get is: "?? _%?     ?>??????? > ?  > ??   ???????  ? (   % ? _%> ?  ??  >?     ? >%?> ?  "
>
>
>
> Regards - Grant
>
>
> Grant Ward Able
> Senior Systems Architect
> Transaction and Messaging Technologies
> DTCC London
> gwardable@dtcc.com
> Phone 0207 650 1496
>
>
>

If you just want to read the file, use ISPF 3.17 on
the directory and then on the file selection list
enter va next to file name to view the file and it
will translate to EBCDIC for you before displaying
the data. Then you have all the familiar 'find'
command options.

If you enter ea instead, you will be in edit of the
file; if you make changes they will be saved (in
ascii) on exit.






--

Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.

303-355-2752
http://www.trainersfriend.com

* To get a good Return on your Investment, first make an investment!
   + Training your people is an excellent investment

* Try our tool for calculating your Return On Investment
     for training dollars at
   http://www.trainersfriend.com/ROI/roi.html

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX
Re: converting from ASCII to EBCDIC
#268
Author: Adrian Stern
Date: Tue, 12 Mar 2013 15:23
54 lines
3542 bytes
If you open the file in the ispf editor there's a command, ebcdic I think,
that will display the file in ebcdic.

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-REXX@VM.MARIST.EDU] On Behalf Of
Ward Able, Grant
Sent: den 12 mars 2013 15:59
To: TSO-REXX@VM.MARIST.EDU
Subject: [TSO-REXX] converting from ASCII to EBCDIC

Hi REXXers,

I need to read a file that resides in an USS directory and search for some
text. However the data in the file in in ASCII format. I have done some
searching but am not able to discover a method of converting the data. I am
pretty sure that this must have been done a number of times by the members
of this list, so can someone please give me a pointer to some document that
I can read up on it?

I have tried reading it, but all I get is: "?? _%?     ?>??????? > ?  > ??
???????  ? (   % ? _%> ?  ??  >?     ? >%?> ?  "



Regards - Grant


Grant Ward Able
Senior Systems Architect
Transaction and Messaging Technologies
DTCC London
gwardable@dtcc.com
Phone 0207 650 1496



<BR>_____________________________________________________________
<FONT size=2><BR>
DTCC DISCLAIMER: This email and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom they are addressed. If you have received this email
in error, please notify us immediately and delete the email and any
attachments from your system. The recipient should check this email
and any attachments for the presence of viruses.  The company
accepts no liability for any damage caused by any virus transmitted
by this email.</FONT>

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX
Re: converting from ASCII to EBCDIC
#269
Author: Paul Gilmartin
Date: Tue, 12 Mar 2013 15:35
16 lines
2217 bytes
On Mar 12, 2013, at 08:59, Ward Able, Grant wrote:
> 
> I need to read a file that resides in an USS directory and search for some text. However the data in the file in in ASCII format. I have done some searching but am not able to discover a method of converting the data. I am pretty sure that this must have been done a number of times by the members of this list, so can someone please give me a pointer to some document that I can read up on it?
>  
I've used iconv(1) for this.  It can be as simple as:

    iconv -f IS0859-1 -t IBM-1047 <ASCII-FILE-NAME

Can the file be tagged as ASCII and autoconversion employed,
or is autoconversion a feature solely of the C RTL?

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX
Re: converting from ASCII to EBCDIC
#270
Author: John McKown
Date: Tue, 12 Mar 2013 16:05
57 lines
3342 bytes
As gil said, have you tried autoconvert? I have it set up. I uploaded a
Linux text file in Binary mode into my z/OS UNIX directory, resulting in an
ASCII encoded text file. I did a

chtag -tc iso8859-1 ascii.text.file

and then ran a simple z/OS UNIX REXX script:

/* rexx */
do while lines() >0
    say linein()
end

chtag 755 x.rexx

./x.rexx <ascii.text.file

and it wrote out properly in EBCDIC.


On Tue, Mar 12, 2013 at 10:34 AM, Paul Gilmartin <PaulGBoulder@aim.com>wrote:

> On Mar 12, 2013, at 08:59, Ward Able, Grant wrote:
> >
> > I need to read a file that resides in an USS directory and search for
> some text. However the data in the file in in ASCII format. I have done
> some searching but am not able to discover a method of converting the data.
> I am pretty sure that this must have been done a number of times by the
> members of this list, so can someone please give me a pointer to some
> document that I can read up on it?
> >
> I've used iconv(1) for this.  It can be as simple as:
>
>     iconv -f IS0859-1 -t IBM-1047 <ASCII-FILE-NAME
>
> Can the file be tagged as ASCII and autoconversion employed,
> or is autoconversion a feature solely of the C RTL?
>
> -- gil
>
> ----------------------------------------------------------------------
> For TSO-REXX subscribe / signoff / archive access instructions,
> send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX
>



--
This is a test of the Emergency Broadcast System. If this had been an
actual emergency, do you really think we'd stick around to tell you?

Maranatha! <><
John McKown

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX
Re: converting from ASCII to EBCDIC
#271
Author: Paul Gilmartin
Date: Tue, 12 Mar 2013 16:24
27 lines
2099 bytes
On Mar 12, 2013, at 10:05, John McKown wrote:
> 
> chtag -tc iso8859-1 ascii.text.file
> 
> /* rexx */
> do while lines() >0
>    say linein()
> end
> 
> chtag 755 x.rexx
> ./x.rexx <ascii.text.file
> 
> and it wrote out properly in EBCDIC.
>  
Is this because linein() is implemented in C?  Would it
work if you used "SYSCALL read?"
> 
> On Tue, Mar 12, 2013 at 10:34 AM, Paul Gilmartin <PaulGBoulder@aim.com>wrote:
>   
>> Can the file be tagged as ASCII and autoconversion employed,
>> or is autoconversion a feature solely of the C RTL?

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX
Re: converting from ASCII to EBCDIC
#273
Author: Brad Whiting
Date: Tue, 12 Mar 2013 16:40
66 lines
3312 bytes
Not sure how helpful this is but I did this read_ascii function using rexx
syscall functions to look at and process WebSphere Z files:

tmp_pth = '/tmp/someascii_file.txt'
call read_ascii tmp_pth
parse var ebc_buf . 'name="'clong.cell_t'"' .
parse var ebc_buf . 'shortName="'cshort.cell_t'"' .
parse var ebc_buf . 'cellType="'ctype.cell_t'"' .

read_ascii:
 parse arg full_path
 ebc_buf = ""
 address syscall "open (full_path) "O_RDONLY
 if retval = -1 then do
    say "Function read_ascii failed to open file"
    say full_path
    say "err" errno "=" errnojr
    return
 end
 fd_ascii = retval

 cmd = cvt_setcvton
 pccsid = '0417'x
 fccsid = '0333'x

 address syscall "f_control_cvt (fd_ascii) cmd pccsid fccsid"

 address syscall "read (fd_ascii) ebc_buf 999999"

 address syscall "close (fd_ascii)"
return



-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-REXX@VM.MARIST.EDU] On Behalf Of
Paul Gilmartin
Sent: Tuesday, March 12, 2013 10:35 AM
To: TSO-REXX@VM.MARIST.EDU
Subject: Re: [TSO-REXX] converting from ASCII to EBCDIC

On Mar 12, 2013, at 08:59, Ward Able, Grant wrote:
>
> I need to read a file that resides in an USS directory and search for some
text. However the data in the file in in ASCII format. I have done some
searching but am not able to discover a method of converting the data. I am
pretty sure that this must have been done a number of times by the members
of this list, so can someone please give me a pointer to some document that
I can read up on it?
>
I've used iconv(1) for this.  It can be as simple as:

    iconv -f IS0859-1 -t IBM-1047 <ASCII-FILE-NAME

Can the file be tagged as ASCII and autoconversion employed, or is
autoconversion a feature solely of the C RTL?

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email
to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX
Re: converting from ASCII to EBCDIC
#275
Author: Paul Gilmartin
Date: Tue, 12 Mar 2013 16:58
26 lines
2381 bytes
On Mar 12, 2013, at 10:38, Brad Whiting wrote:

> Not sure how helpful this is but I did this read_ascii function using rexx
> syscall functions to look at and process WebSphere Z files:
>
Thanks for the example!

I've been doing something similar, using the Rexx TRANSLATE()
function.  This is likely more efficient.

> cmd = cvt_setcvton
> pccsid = '0417'x
> fccsid = '0333'x
>
I assume these are, or could be, some code for IBM-1047
and ISO8859-1.  I need to RTFM.

So, apparently, either autoconversion doesn't depend on the
C RTL, or address SYSCALL is implemented in C.

Thanks again,
gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX
Re: converting from ASCII to EBCDIC
#276
Author: Ward Able, Grant
Date: Tue, 12 Mar 2013 17:06
165 lines
4901 bytes
Brad - this has done the trick! Thanks very much. I had played about with f_control_cvt earlier, but obviously did not get everything specified correctly.





Regards - Grant.

Telephone Internal: 201496 (London)

Telephone External: +44 (0)207 650 1496





-----Original Message-----

From: TSO REXX Discussion List [mailto:TSO-REXX@VM.MARIST.EDU] On Behalf Of Brad Whiting

Sent: 12 March 2013 16:39

To: TSO-REXX@VM.MARIST.EDU

Subject: Re: [TSO-REXX] converting from ASCII to EBCDIC



Not sure how helpful this is but I did this read_ascii function using rexx syscall functions to look at and process WebSphere Z files:



tmp_pth = '/tmp/someascii_file.txt'

call read_ascii tmp_pth

parse var ebc_buf . 'name="'clong.cell_t'"' .

parse var ebc_buf . 'shortName="'cshort.cell_t'"' .

parse var ebc_buf . 'cellType="'ctype.cell_t'"' .



read_ascii:

 parse arg full_path

 ebc_buf = ""

 address syscall "open (full_path) "O_RDONLY  if retval = -1 then do

    say "Function read_ascii failed to open file"

    say full_path

    say "err" errno "=" errnojr

    return

 end

 fd_ascii = retval



 cmd = cvt_setcvton

 pccsid = '0417'x

 fccsid = '0333'x



 address syscall "f_control_cvt (fd_ascii) cmd pccsid fccsid"



 address syscall "read (fd_ascii) ebc_buf 999999"



 address syscall "close (fd_ascii)"

return







-----Original Message-----

From: TSO REXX Discussion List [mailto:TSO-REXX@VM.MARIST.EDU] On Behalf Of Paul Gilmartin

Sent: Tuesday, March 12, 2013 10:35 AM

To: TSO-REXX@VM.MARIST.EDU

Subject: Re: [TSO-REXX] converting from ASCII to EBCDIC



On Mar 12, 2013, at 08:59, Ward Able, Grant wrote:

>

> I need to read a file that resides in an USS directory and search for 

> some

text. However the data in the file in in ASCII format. I have done some searching but am not able to discover a method of converting the data. I am pretty sure that this must have been done a number of times by the members of this list, so can someone please give me a pointer to some document that I can read up on it?

>

I've used iconv(1) for this.  It can be as simple as:



    iconv -f IS0859-1 -t IBM-1047 <ASCII-FILE-NAME



Can the file be tagged as ASCII and autoconversion employed, or is autoconversion a feature solely of the C RTL?



-- gil



----------------------------------------------------------------------

For TSO-REXX subscribe / signoff / archive access instructions, send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX



----------------------------------------------------------------------

For TSO-REXX subscribe / signoff / archive access instructions, send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX

<BR>_____________________________________________________________

<FONT size=2><BR>

DTCC DISCLAIMER: This email and any files transmitted with it are

confidential and intended solely for the use of the individual or

entity to whom they are addressed. If you have received this email

in error, please notify us immediately and delete the email and any

attachments from your system. The recipient should check this email

and any attachments for the presence of viruses.  The company

accepts no liability for any damage caused by any virus transmitted

by this email.</FONT>

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads