The character ÿ causes end-of-file



Help for C/C++ for MVS, OS/390 C/C++, z/OS C/C++ and C/C++ Productivity Tools for OS/390

The character ÿ causes end-of-file

Postby zatlas1 » Fri Jul 20, 2012 3:37 am

Hi
I am getting ASCII text files and the FTP convert them to EBCDIC. Specifically the character 'ÿ' is translated to x'ff'. That should not be a problem but both in C and Rexx, when reading the file abruptly stop reading as if it was an unexpected EOF. Is that behavior normal and if so what could be done about it, short of translating the offending character to something else?

Thank you
ZA
zatlas1
 
Posts: 61
Joined: Mon Mar 15, 2010 9:19 am
Has thanked: 0 time
Been thanked: 0 time

Re: The character ÿ causes end-of-file

Postby dick scherrer » Fri Jul 20, 2012 7:14 am

Hello,

What does the record look like when viewed with HEX ON? And the next record?
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: The character ÿ causes end-of-file

Postby zatlas1 » Fri Jul 20, 2012 8:41 am

I actually misstated the issue, the character at issue is x'ff' in the ASCII. Here is the section where that character appears in the original ASCII file:
Hex:
20 20 20 20 66 74 68 69 6E 67 0A 20 20 20 20 2A 2A 2A 20 46 61 69 6C 65 72 73 0A 20 20 20 20 5D 74 68 69 6E 67 0A 20 20 20 20 63 74 68 69 6E 67 0A 20 20 20 20 64 74 68 69 6E 67 0A 20 20 20 20 65 74 68 69 6E 67 0A 0A 2F 5E 5C 81 2F 0A 20 20 20 20 81 0A 0A 2F 5E FF 2F 0A 20 20 20 20 FF 0A 0A 2F 5E

Text:
fthing
*** Failers
]thing
cthing
dthing
ething

/^\/


/^ÿ/
ÿ

/^

On the z/OS side it looks like this:

   File  Edit  Edit_Settings  Menu  Utilities  Compilers  Test  Help
 -------------------------------------------------------------------------------
 EDIT       ZATLAS1.TEST.INPUT1                             Columns 00001 00072
 Command ===>                                                  Scroll ===> CSR
 000153     cthing
        44448A889844444444444444444444444444444444444444444444444444444444444444
        000033895700000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000154     dthing
        44448A889844444444444444444444444444444444444444444444444444444444444444
        000043895700000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000155     ething
        44448A889844444444444444444444444444444444444444444444444444444444444444
        000053895700000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000156
        444444444444444444444444444444444444444444444444444444444444444444444444
        000000000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000157 /^\ /
        6BE264444444444444444444444444444444444444444444444444444444444444444444
        100110000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000158
        444424444444444444444444444444444444444444444444444444444444444444444444
        000010000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000159
        444444444444444444444444444444444444444444444444444444444444444444444444
        000000000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000160 /^
        6B4444444444444444444444444444444444444444444444444444444444444444444444
        100000000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 ****** **************************** Bottom of Data ****************************






================================================================================
   File  Edit  Edit_Settings  Menu  Utilities  Compilers  Test  Help
 -------------------------------------------------------------------------------
 EDIT       ZATLAS1.TEST.INPUT1                             Columns 00001 00072
 Command ===>                                                  Scroll ===> CSR
 000153     cthing
        44448A889844444444444444444444444444444444444444444444444444444444444444
        000033895700000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000154     dthing
        44448A889844444444444444444444444444444444444444444444444444444444444444
        000043895700000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000155     ething
        44448A889844444444444444444444444444444444444444444444444444444444444444
        000053895700000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000156
        444444444444444444444444444444444444444444444444444444444444444444444444
        000000000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000157 /^\ /
        6BE264444444444444444444444444444444444444444444444444444444444444444444
        100110000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000158
        444424444444444444444444444444444444444444444444444444444444444444444444
        000010000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000159
        444444444444444444444444444444444444444444444444444444444444444444444444
        000000000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000160 /^
        6B4444444444444444444444444444444444444444444444444444444444444444444444
        100000000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 ****** **************************** Bottom of Data ****************************






================================================================================
   File  Edit  Edit_Settings  Menu  Utilities  Compilers  Test  Help
 -------------------------------------------------------------------------------
 EDIT       ZATLAS1.TEST.INPUT1                             Columns 00001 00072
 Command ===>                                                  Scroll ===> CSR
 000153     cthing
        44448A889844444444444444444444444444444444444444444444444444444444444444
        000033895700000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000154     dthing
        44448A889844444444444444444444444444444444444444444444444444444444444444
        000043895700000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000155     ething
        44448A889844444444444444444444444444444444444444444444444444444444444444
        000053895700000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000156
        444444444444444444444444444444444444444444444444444444444444444444444444
        000000000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000157 /^\ /
        6BE264444444444444444444444444444444444444444444444444444444444444444444
        100110000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000158
        444424444444444444444444444444444444444444444444444444444444444444444444
        000010000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000159
        444444444444444444444444444444444444444444444444444444444444444444444444
        000000000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000160 /^
        6B4444444444444444444444444444444444444444444444444444444444444444444444
        100000000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 ****** **************************** Bottom of Data ****************************

so the hex code '2F 5E FF' was translated almost correctly to '61 B0 ..' and then the system does not see the rest.

Thanks
ZA
zatlas1
 
Posts: 61
Joined: Mon Mar 15, 2010 9:19 am
Has thanked: 0 time
Been thanked: 0 time


Return to C, C++

 


  • Related topics
    Replies
    Views
    Last post