* "F" (file) specs define files and other i/o devices
FARMstF1 UF E K Disk Rename(ARMST:RARMST)
* "D" specs are used to define variables and parameters
* The "prototype" for the program is in a separate file
* allowing other programs to call it
/copy cust_pr
* The "procedure interface" describes the *ENTRY parameters
D getCustInf PI
D pCusNo 6p 0 const
D pName 30a
D pAddr1 30a
D pAddr2 30a
D pCity 25a
D pState 2a
D pZip 10a
/free
// The "chain" command is used for random access of a keyed file
chain pCusNo ARMstF1;
// If a record is found, move fields from the file into parameters
if %found;
pName = ARNm01;
pAddr1 = ARAd01;
pAddr2 = ARAd02;
pCity = ARCy01;
pState = ARSt01;
pZip = ARZp15;
endif;
// RPG makes use of switches. One switch "LR" originally stood for "last record"
//LR actually flags the program and its dataspace as removable from memory.
*InLR = *On;
/end-free
Объяснение:
Для этого представим кол-во ьукв в алфавите в степени числа два
16=2^4 => i= 4 бита
Так же для второго:
256 = 2^8 =>i= 8бит
Кол-во символов одиннаковое, составим отношение алфавитных подходов
(K)
n*i/ n * i. n сокращаем.
8/4= 2 Разница в два раза.
Для письменной работы:
Дано:
K1=K2
N1=16
N2=256
I1/I2-?
Решение:
N=2^i
16=2^4 => i= 4 бита
256 = 2^8 =>i= 8бит
I(Инф. обьес всего файла)= K*i
I1/I2= K 1i / K 2i. K сокращаем
1i / 2i
4/8= 2. (Большое на меньшее делить надо)
В два раза кол-во инфооиации во втором тексте больше, чем в первом
* "F" (file) specs define files and other i/o devices
FARMstF1 UF E K Disk Rename(ARMST:RARMST)
* "D" specs are used to define variables and parameters
* The "prototype" for the program is in a separate file
* allowing other programs to call it
/copy cust_pr
* The "procedure interface" describes the *ENTRY parameters
D getCustInf PI
D pCusNo 6p 0 const
D pName 30a
D pAddr1 30a
D pAddr2 30a
D pCity 25a
D pState 2a
D pZip 10a
/free
// The "chain" command is used for random access of a keyed file
chain pCusNo ARMstF1;
// If a record is found, move fields from the file into parameters
if %found;
pName = ARNm01;
pAddr1 = ARAd01;
pAddr2 = ARAd02;
pCity = ARCy01;
pState = ARSt01;
pZip = ARZp15;
endif;
// RPG makes use of switches. One switch "LR" originally stood for "last record"
//LR actually flags the program and its dataspace as removable from memory.
*InLR = *On;
/end-free
Объяснение: