- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Yesterday, after revisiting, all the changes, I did in the z390 library, I found out, one that escape me to tell you ( It was a long time).
That is regarding the use of X2C function within FQM8921C data assembler
Â
Its seems, regarding, the test I did, z390 only allows a one byte length, as X2C hex string input.
So looks like a bug, also.
Can you post that on the z390 project?
Antonio Vale Macedo
ORIGINAL CODE:
  private void exec_pc_x2b(){
              /*
               * convert hex string to binary string
               */
              check_setc_quotes(1); // RPI 1139
              setc_value1 = get_setc_stack_value();
              seta_value1 = Integer.valueOf(setc_value1,16);
                               setc_value = Integer.toString(seta_value1,2);
                               seta_value = setc_value.length();
                               seta_value = seta_value - seta_value/8*8;
                               if (seta_value != 0){
                                               setc_value = "00000000".substring(seta_value) + setc_value;
                               }
                               put_setc_stack_var();
   }
RESULT: Error
".\input\FQM8921C.AASM"
09:23:49 FQM8921CÂ MZ390 START USING z390 V1.5.06 ON J2SE 1.8.0_211 03/02/21
MZ390E abort 84 file=1 line=43 internal system exception - java.lang.NumberFormatException: For input string: "30313233343536373839616263646566414243444546"
MZ390I total mnote warnings = 0
MZ390I total mnote errors  = 0
MZ390I max  mnote level   = 0
MZ390I total mz390 errors  = 1
09:23:49 FQM8921CÂ MZ390 ENDEDÂ Â RC=16 SEC= 0 MEM(MB)= 32 IO=344
CHANGED CODE:Â
   private void exec_pc_x2c(){
              /*
               * convert hex string to char string
               */
              check_setc_quotes(1); // RPI 1139
              setc_value1 = get_setc_stack_value();
              /* AVM
              seta_value = Integer.valueOf(setc_value1,16);
                               setc_value = ""
                                                     + (char)tz390.ebcdic_to_ascii[seta_value >>> 24]
                                                     + (char)tz390.ebcdic_to_ascii[seta_value >>> 16 & 0xff]       Â
                                                      + (char)tz390.ebcdic_to_ascii[seta_value >>> 8 & 0xff]
                                                     + (char)tz390.ebcdic_to_ascii[seta_value       & 0xff]                                                                                            Â
                                                      ;
                               */         Â
              /*AVM-INI*/
                               StringBuilder stb = new StringBuilder("");
                               for (int i = 0; i < setc_value1.length(); i += 2) {
                      String str = setc_value1.substring(i, i + 2);
                      stb.append((char) Integer.parseInt(str, 16));
                  }
                               setc_value = stb.toString();
                               /*AVM-END*/
                               put_setc_stack_var();
   }
RESULT:OK
09:33:05 FQM8921CÂ MZ390 START USING z390 V1.5.06 ON J2SE 1.8.0_211 03/02/21
MZ390I total mnote warnings = 0
MZ390I total mnote errors  = 0
MZ390I max  mnote level   = 0
MZ390I total mz390 errors  = 0
09:33:06 FQM8921CÂ MZ390 ENDEDÂ Â RC= 0 SEC= 0 MEM(MB)= 39 IO=1311
09:33:08 FQM8921CÂ AZ390 START USING z390 V1.5.06 ON J2SE 1.8.0_211 03/02/21
09:33:10 FQM8921CÂ AZ390 ENDEDÂ Â RC= 0 SEC= 2 MEM(MB)= 64 IO=6493
09:33:11 FQM8921CÂ LZ390 START USING z390 V1.5.06 ON J2SE 1.8.0_211 03/02/21
09:33:11 FQM8921CÂ LZ390 ENDEDÂ Â RC= 0 SEC= 0 MEM(MB)= 55 IO=8636########################################################################
   private void exec_pc_x2b(){
              /*
               * convert hex string to binary string
               */
              check_setc_quotes(1); // RPI 1139
              setc_value1 = get_setc_stack_value();
              seta_value1 = Integer.valueOf(setc_value1,16);
                               setc_value = Integer.toString(seta_value1,2);
                               seta_value = setc_value.length();
                               seta_value = seta_value - seta_value/8*8;
                               if (seta_value != 0){
                                               setc_value = "00000000".substring(seta_value) + setc_value;
                               }
                               put_setc_stack_var();
   }
########################################################################
".\input\FQM8921C.AASM"
09:23:49 FQM8921CÂ MZ390 START USING z390 V1.5.06 ON J2SE 1.8.0_211 03/02/21
MZ390E abort 84 file=1 line=43 internal system exception - java.lang.NumberFormatException: For input string: "30313233343536373839616263646566414243444546"
MZ390I total mnote warnings = 0
MZ390I total mnote errors  = 0
MZ390I max  mnote level   = 0
MZ390I total mz390 errors  = 1
09:23:49 FQM8921CÂ MZ390 ENDEDÂ Â RC=16 SEC= 0 MEM(MB)= 32 IO=344
########################################################################
Â
   private void exec_pc_x2c(){
              /*
               * convert hex string to char string
               */
              check_setc_quotes(1); // RPI 1139
              setc_value1 = get_setc_stack_value();
              /* AVM
              seta_value = Integer.valueOf(setc_value1,16);
                               setc_value = ""
                                                     + (char)tz390.ebcdic_to_ascii[seta_value >>> 24]
                                                     + (char)tz390.ebcdic_to_ascii[seta_value >>> 16 & 0xff]       Â
                                                      + (char)tz390.ebcdic_to_ascii[seta_value >>> 8 & 0xff]
                                                     + (char)tz390.ebcdic_to_ascii[seta_value       & 0xff]                                                                                            Â
                                                      ;
                               */         Â
              /*AVM-INI*/
                               StringBuilder stb = new StringBuilder("");
                               for (int i = 0; i < setc_value1.length(); i += 2) {
                      String str = setc_value1.substring(i, i + 2);
                      stb.append((char) Integer.parseInt(str, 16));
                  }
                               setc_value = stb.toString();
                               /*AVM-END*/
                               put_setc_stack_var();
   }
########################################################################
".\input\FQM8921C.AASM"
09:33:05 FQM8921CÂ MZ390 START USING z390 V1.5.06 ON J2SE 1.8.0_211 03/02/21
MZ390I total mnote warnings = 0
MZ390I total mnote errors  = 0
MZ390I max  mnote level   = 0
MZ390I total mz390 errors  = 0
09:33:06 FQM8921CÂ MZ390 ENDEDÂ Â RC= 0 SEC= 0 MEM(MB)= 39 IO=1311
09:33:08 FQM8921CÂ AZ390 START USING z390 V1.5.06 ON J2SE 1.8.0_211 03/02/21
09:33:10 FQM8921CÂ AZ390 ENDEDÂ Â RC= 0 SEC= 2 MEM(MB)= 64 IO=6493
09:33:11 FQM8921CÂ LZ390 START USING z390 V1.5.06 ON J2SE 1.8.0_211 03/02/21
09:33:11 FQM8921CÂ LZ390 ENDEDÂ Â RC= 0 SEC= 0 MEM(MB)= 55 IO=8636
Fred,
Thank you for reporting the issue. I have created RPI 1646 to cover the case:
RPI 1646 | 2021-02-03 | X2C and X2B functions fail on multi-byte input data. See mail by Fred van der Windt dd 2021-02-03 12:18 |
I am currently focussing on the zVSAM project.
Hopefully Don can find some time to validate and incorporate the
proposed change.
Kind regards,
Abe
===
--
You received this message because you are subscribed to the Google Groups "z390" group.
To unsubscribe from this group and stop receiving emails from it, send an email to z390+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/z390/2364a13b-f313-48bf-9771-7523b83ca556n%40googlegroups.com.