Page 1 of 2

CCN5825 message while compiling the code.

PostPosted: Fri Sep 30, 2022 12:18 am
by valeca
Hi everyone,
After bringing the code from PC to Z/OS using IND$FILE, the compiler produces the next messages
CCN5825 (W) The character "\xba" is not allowed.
CCN5825 (W) The character "\xbb" is not allowed.
These characters are '[' and ']' in EBCDIC 037 codepage and are shown properly in ISPF.
I tried different EBCDIC 1047 codepage, but in the ISPF they look improperly, but the messages are still the same.
I read the previous post about this issue, but changing terminal type as advised didn't help
( forum-f12/topic4056.html )
I wonder what EBCDIC code page the C/C++ Z/OS compiler is using?
I tried different code pages for PC <->Host combinations, like
ANSI(WinLatin1)(1252) <-> English US(037) etc., and still getting same messages.
Any advise is appreciated.
Thanks!

Re: CCN5825 message while compiling the code.

PostPosted: Fri Sep 30, 2022 1:42 am
by sergeyken
There is a problem with incompatible character codes for square brackets. X'BA' and X'BB' are looking as square brackets on the screen, but not for C++ compiler...

The workaround is, using triplexes(?) if I remember correctly.
Replace all X'BA' (looking as '[') with '??(', and all X'BB' (looking as ']') with '??)'
Doesn't look attractive, but is working...

char line??(100??);
int array??( 1000, 20 ??);

Re: CCN5825 message while compiling the code.

PostPosted: Fri Sep 30, 2022 10:01 am
by valeca
Thanks, Sergey. This seems to be the only way to do it.
In manual they are called trigraphs, and the suggestion is similar to yours.
Is any way to replace all occurrences of the '\xba' with '??(' in the code with a single command?
Thanks!

Re: CCN5825 message while compiling the code.

PostPosted: Fri Sep 30, 2022 4:54 pm
by sergeyken
valeca wrote:Is any way to replace all occurrences of the '\xba' with '??(' in the code with a single command?
Thanks!

While using ISPF Edit option, you can use the commands (both at once):
Change ALL X'BA' '??(' ; C ALL X'BB' '??)'


Some companies have installed their own command scripts, to allow applying any Edit subcommand to all members of the PDS at once.
I remember I used such command (from the Member List screen):
Global C ALL '[' '??('

Re: CCN5825 message while compiling the code.

PostPosted: Fri Sep 30, 2022 5:05 pm
by sergeyken
If a command like GLOBAL is not available, but you have hundreds or thousands of C-members, there is also batch solution available with only standard utilities: IEBPTPCH+SORT+IEBUPDTE, to do this task for the whole library in one pass.

Re: CCN5825 message while compiling the code.

PostPosted: Fri Sep 30, 2022 9:44 pm
by valeca
Sounds good. Thanks.
The company uses PF buttons to replace these chars, but replacing all at once is the way to go.
Thanks for sharing!

Re: CCN5825 message while compiling the code.

PostPosted: Fri Sep 30, 2022 9:56 pm
by valeca
sergeyken wrote:If a command like GLOBAL is not available, but you have hundreds or thousands of C-members, there is also batch solution available with only standard utilities: IEBPTPCH+SORT+IEBUPDTE, to do this task for the whole library in one pass.

Sergey, any chance to share JCL? Will save me time :mrgreen: Thanks.

Re: CCN5825 message while compiling the code.

PostPosted: Fri Sep 30, 2022 10:37 pm
by sergeyken
valeca wrote:
sergeyken wrote:If a command like GLOBAL is not available, but you have hundreds or thousands of C-members, there is also batch solution available with only standard utilities: IEBPTPCH+SORT+IEBUPDTE, to do this task for the whole library in one pass.

Sergey, any chance to share JCL? Will save me time :mrgreen: Thanks.

I did such manipulations several times in my life (not for square brackets in C++, but also global text update in PDS), when GLOBAL command was not available.

I don't have it with me right now (they all left at my previous companies), but I can reproduce it, after a while.

The total size of such JCL procedure is about 100 JCL lines, or so.

Re: CCN5825 message while compiling the code.

PostPosted: Fri Sep 30, 2022 10:59 pm
by valeca
Sounds promising :P Thanks!

Re: CCN5825 message while compiling the code.

PostPosted: Fri Sep 30, 2022 11:01 pm
by sergeyken
Another solution may be: to make only temporary updates of square brackets encoding at the time of compilation. In this case the source code will remain attractive for reading in the library, but is modified for C++ compiler needs just before its compilation. You can use either your own compilation procedures, or request modification of the common company-wide procedures.

This modification is fully backward compatible: those modules already prepared for using trigraphs will be handled seamlessly.

//SUPERCPP PROC SOURCE='library(member)'
//*=========================================================
//PREPARE  EXEC PGM=SORT
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DISP=SHR,DSN=&SOURCE
//SORTOUT  DD  DISP=(NEW,PASS),SPACE=(TRK,(50,50)),DSN=&&NEWCODE
//SYSIN    DD  *
 SORT FIELDS=COPY
 OUTREC FINDREP=(INOUT=(C'[',C'??(',
                        C']',C'??)'))
 END
//*=========================================================
//CPP      EXEC PGM=your-C-compiler
// . . . . . . . . . . .
//SYSIN    DD  DISP=(OLD,DELETE),DSN=&&NEWCODE
// . . . . . . . .
//*=========================================================
//         PEND