Ver la Versión Completa : [Sintaxis] ¿Para qué es el PIC 1() BIT ?
Kuk
22 de abril de 2016, 11:23
Amigos, pues eso, para qué es el PIC 1? Existe sin BIT y con BIT...
Dasije
23 de abril de 2016, 20:28
En base de datos de Microsoft como Access o SQL Server, sería los valores True/False, en COBOL sería un campo numérico de un solo carácter que solo tiene dos números validos 0 y 1.
01 VERDADERO PIC 1 BIT VALUE B"1".
01 FALSO PIC 1 BIT VALUE B"0".
Saludos.
Kuk
23 de abril de 2016, 22:10
Dasije, según el manual, no es sólo 0 o 1, ùede haber más longitud, es por eso que no me estoy enterando:
Example of Insertion of a Slack Bit (1)
Below is an example of a slack bit insertion for the following record description
entry.
01 RECORD-A.
02 DATA-A1.
03 DATA-A11 PIC 1(4) BIT.
03 DATA-A12 PIC 1(3) BIT SYNC.
03 DATA-A13 PIC 1(5) BIT.
02 DATA-A2 PIC 1(4) BIT.
DATA-A12 is allocated to a one-byte boundary, so four slack bits are inserted
between DATA-A11 and DATA-A12.
A one-byte area is allocated to DATA-A12, so five slack bits are inserted between
DATA-A12 and DATA-A13.
DATA-A13 is the last internal Boolean data item subordinate to DATA-A1, so three
slack bits are inserted after DATA-A13.
The above record description entry is equivalent to the example shown below.
01 RECORD-A.
02 DATA-A1.
03 DATA-A11 PIC 1(4) BIT.
03 FILLER PIC 1(4) BIT. <-- Slack bit
03 DATA-A12 PIC 1(3) BIT.
03 FILLER PIC 1(5) BIT. <-- Slack bit
03 DATA-A13 PIC 1(5) BIT.
03 FILLER PIC 1(3) BIT. <-- Slack bit
02 DATA-A2 PIC 1(4) BIT.
Example of Insertion of a Slack Bit (2)
Below is an example of a slack bit insertion in a group item where an OCCURS clause
has been specified for the following record description entry.
01 RECORD-B.
02 DATA-B1 OCCURS 10 TIMES.
03 DATA-B11 PIC 1(5) BIT.
03 DATA-B12 PIC 1(5) BIT.
DATA-B1 is allocated to begin on a one-byte boundary where DATA-B1 is repeated.
Therefore, six slack bits are inserted after DATA-B12. The slack bits inserting method
is the same as the repetition of DATA-B1.
When an OCCURS clause has been specified in a Boolean data item containing no
SYNCHRONIZED clause, no slack bit is inserted between each table element
occurrence. For example, no slack bit is inserted between each occurrence of DATAC1 in the case shown below.
02 DATA-C1 PIC 1(3) BIT OCCURS 6.
vBulletin v3.8.7, Derechos ©2000-2026, Jelsoft Enterprises Ltd.