Rif: Re: converting character to packed

2016-10-19 Thread aldo . crosio
The first question I must ask is:
what is the main language?
the string to be converted is fixed or variable length?
whether before or after the string?
the currency above, following the string and, contiguous or separated?
there is a need to vary parametrically decimal point or currency?

 In case of cobol what is the arrival picture?
For example:
01 output   S9(017)V9(2)  COMP-3.

It will correct answers to the strings that follow?


"^" character to indicate blanks.
.. 1 2 3 4 5 6 7 8 9 0’
$1,234.56   x’0123456c’
1,234.56x’0123456c’
-1,234.56   x’0123456d’
1,234,567.89x’00123456789c’
1234567,89  x’00123456789c’
-1234567,89 x’00123456789d’
123.4.567,89error
123456789   x’12345678900c
1,234,567.8934^^x’00123456789c’
^^^1234.56  x’0123456c’
$^^^1234.56 x’0123456c’
-^^^1234.56 x’0123456d’
^^^1234.56- x’0123456d’


Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute nel 
presente messaggio, corredato dei relativi allegati, sono strettamente 
riservate ed a uso esclusivo dei destinatari. Qualora Le fosse pervenuto per 
errore, La invitiamo ad eliminarlo immediatamente, dandocene gentilmente 
comunicazione. Grazie.
 ***  ***  *** 



Rif: Re: converting character to packed

2016-10-18 Thread aldo . crosio
The first question I must ask is:
what is the main language?
the string to be converted is fixed or variable length?
whether before or after the string?
the currency above, following the string and, contiguous or separated?
there is a need to vary parametrically decimal point or currency?

Furthermore:
I believe that you have the need to have a multi-function editing routine.
He also never thought of using, for the calculation and / or alignment of
floating point fields?

in particular a similar function:
The edited numeric string can contain the sign (first or last significant
position) the decimal separator and one or more separators  properly
positioned


Call is like:
Workink-storage.
01  HDNUM-PKT.
88   HDNUM__STRIP_NUM   VALUE   1.
88   HDNUM__STRIP   VALUE   2.
88   HDNUM__TRIMVALUE   3.
88   HDNUM__STRIP_NUM_TRIM  VALUE   4.
88   HDNUM__STRIP_TRIM  VALUE   5.
88   HDNUM__STR_HFP VALUE   6.
88   HDNUM__VSTR_HFPVALUE   7.
88   HDNUM__BIN_HFP VALUE   8.
88   HDNUM__B32_HFP VALUE   8.
88   HDNUM__B64_HFP VALUE   9.
88   HDNUM__HFP_STR VALUE  10.
88   HDNUM__HFP_STRRVALUE  11.
88   HDNUM__HEX_H   VALUE  12.
88   HDNUM__HEX_W   VALUE  13.
88   HDNUM__HEX_D   VALUE  14.
88   HDNUM__NUMERO  VALUE  15.
88   HDNUM__OPTION-TRAILING VALUE  16.
88   HDNUM__OPTION-LEADING  VALUE  17.
88   HDNUM__OPTION-BOTH VALUE  18.
88   HDNUM__OPTION-COMPRESS VALUE  19.
88   HDNUM__OPTION-ALL  VALUE  20.
88   HDNUM__COMPRESSVALUE  21.
88   HDNUM__ALL VALUE  22.
88   HDNUM__NUMERO_FIX  VALUE  23.
88   HDNUM__VSTR_HFP_CLOB   VALUE  24.
88   HDNUM__HFPS_STRVALUE  25.
88   HDNUM__HFPS_STRR   VALUE  26.
88   HDNUM__DECIMAL VALUE  27.
88   HDNUM__STR_HFP_CLOBVALUE  28.
88   HDNUM__LSPALL  VALUE  29.
88   HDNUM__NUMERIC VALUE  30.
88   HDNUM__GRAFIC  VALUE  31.
88   HDNUM__STRHFP_2VALUE  32.
88   HDNUM__VSTRHFP_2   VALUE  33.
02 UNIEDIT-SUBFUN   PIC S9(04) BINARY.
02 UNIEDIT-CODES.
   04 UNIEDIT_FCPIC S9(04) BINARY.
   04 UNIEDIT_FSPIC S9(04) BINARY.
   04 UNIEDIT_EXTRA_FNCTPIC X(4).
  88  HDNUM_VIRGOLA VALUE X'FFEF6B00'.
  88  HDNUM_VIRGOLA_X   VALUE X'FFEF6B6B'.
  88  HDNUM_PUNTO   VALUE X'FFEF4B00'.
  88  HDNUM_PUNTO_X VALUE X'FFEF4B4B'.
  88  HDNUM_ONLY_ABEND  VALUE X'FFEF'.
   04 UNIEDIT_EXTRA_1  REDEFINES UNIEDIT_EXTRA_FNCT.

  06  FILLERPIC X(2).
  88  HDNUM_ABEND   VALUE X''.
  06  FILLERPIC X(2).

01  LS-CAMPO-GRAFPIC X(48).
01  XML-P2-LEN   PIC S9(8) BINARY.
01  HFP-RESP.
02  HFP-STAT   PIC  S9(9)   BINARY.
02  HFP-SEGNO  PIC  S9(9)   BINARY.
02  HFP-DATI-HFP.
04  HDRESP-RISULTATO   COMP-2.
04  HDRESP-INT-18  PIC  S9(18)  BINARY.
04  HDRESP-INTERO  PIC  S9(18)  BINARY.
04  HDRESP-DECIMALEPIC  S9(18)  BINARY.
04  HDNUM-STRLGTH  PIC  S9(4)   BINARY.
04  HDNUM-STR.
05  HDNUM-STRCHAR  PIC  X
   OCCURS1 TO 48
   DEPENDING ON HDNUM-STRLGTH.

Procedure division.
MOVE your-string to LS-CAMPO-GRAF TO LEN
MOVE LENGTH  OF LS-CAMPO-GRAF TO LEN
SET  HDNUM__GRAFIC  TO   TRUE
CALL UNI_EDIT   USING HDNUM-PKT
LEN
LS-CAMPO-GRAF
HFP-RESP

In particolare:

In  HDRESP-RISULTATO   result in floating-point ecc….



Aldo Crosio
tel:   051-4991812 /3488858416
fax:  051-6255762


CSE Consorzio Servizi Bancari
Società consortile a responsabilità limitata
Via Emilia n. 272
40068-San Lazzaro di Savena (BO)


Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute nel 
presente messaggio, corredato dei relativi allegati, sono strettamente 
riservate ed a uso esclusivo dei destinatari. Qualora Le fosse pervenuto per 
errore, La invitiamo ad eliminarlo immediatamente, dandocene gentilmente 
comunicazione. Grazie.
 ***  ***  ***