Winter 1998
|
F-correlatives continued...
STATUS
001 A
002 28
003 Status
004
005
006
007
008 B;MESSAGE.STATUS
009 T
010 30
MESSAGE.STATUS
001 SUBROUTINE MESSAGE.STATUS
002 INCLUDE BASLIB ACCESS.COMMON
003 BEGIN CASE
004 CASE CURRENT$='S'
005 CURRENT$='Sent on '
006 CURRENT$=CURRENT$:OCONV (ITEM$<21>,'D2/')
007 CURRENT$=CURRENT$:' at '
008 CURRENT$=CURRENT$:OCONV (ITEM$<22>,MTS)
009 CASE CURRENT$='B'
010 CURRENT$=Verbally confirm receipt
011 CASE CURRENT$=F
012 CURRENT$=Failed - :ITEM$<25>
013 CASE 1
014 CURRENT$='Posted on '
015 CURRENT$=CURRENT$:OCONV (ITEM$<5>,D2/)
016 CURRENT$=CURRENT$: at
017 CURRENT$=CURRENT$:OCONV (ITEM$<6>,MTS)
018 END CASE
019 RETURN CURRENT$
S | Sent on 30/06/94 at 10:43:57 |
B | Verbally confirm receipt |
F | Failed - No response from remote fax machine |
P | Posted on 30/06/94 at 10:44:43 |
STATUS
001 A
002 28
003 Status
004
005
006
007
008 AN(SENT):N(CONFIRM):N(FAILED):N(POSTED)
009 T
010 30
SENT
001 A
002 0
003 Sent Status
004
005
006
007
008 F28;S;#;999;*; Sent on ;21;(D2/);:;
at ;:;22;(MTS);:;;999;[]
090 L
010 30
CONFIRM
001 A
002 0
003 Probable Status
004
005
006
007
008 F28;B;#;999;*;Verbally confirm receipt;;999;[]
009 L
010 30
FAILED
001 A
002 0
003 Failed Status
004
005
006
007
008 F28;F;#; 999;*;Failed - ;25;:;;999;[]
009 L
010 30
POSTED
001 A
002 0
003 Posted Status
004
005
006
007
008 F28;P;#;999;*;Posted on ;5;(D2/);:;
at ;:;6;(MTS);: ;; 999;[]
009 L
010 30
Example 3
On output, ACCESS lists multivalued attributes in the same column, each
value being on a new line. Thus address-lines stored as multivalues appear
on listings in a single, neat column. If you store address lines in individual
attributes you might have tried to emulate the above effect via a C-correlative
which concatenates the address lines with value-marks. Needless to say this
doesnt work! However, the following F-correlative does work:
COLUMNAR.ADDRESS
001 A
002 0
003 Address
004
005
006
007
008 F8;(ML#30);9;(ML#30);:;10;(ML#30);:;11;(ML#30);:;12;(ML#30);:;14;:
009 T
010 30
Where the maximum address-line length is 30 characters, the 5 address-lines
are stored in attributes 8-12 and the postcode is stored in attribute 14.
The T in attribute 9 of the A-pointer effectively forces ACCESS to wrap
the output at character 31, 62, 93 etc and as each address-line is formatted
to 30 characters (by ML#30) the entire address appears in a single column,
each address-line on a new line, just as if the address was stored in multivalues.
Example 4
To output a date stored in attribute n in the format:
use the following combination of F- and A- correlatives:
FULL.DATE
001 A
002 0
003 Full Date
004
005
006
007
008 Fn(DD)]AIF R(LPV,10")= 1 AND LPV#11
THEN st ELSE IF R(LPV, 10)= 2 AND LPV#
12 THEN nd ELSE IF R(LPV , 10)=3
AND LPV#13 THEN rd ELSE th]Fn(DD);LPV;
:; ;:;n(DMA);(MCT);:; ;:;n(DY);:
009 L
010 20
Example 5
To output the age in years for a date of birth stored in attribute n:
AGE
001 A
002 0
003 Age
004
005
006
007
008 FD(DM);D(DD);:;n(DM);n(DD);:;>;-1;*;D(DY);n(DY);-;+
009 R
010 3
B | Used with the B option of BREAK-ON to insert the break quantity in the footing. |
C | Centres the footing line. |
D | Prints current, external date i.e. 16 FEB 1994. |
Fn | Prints current data filename. Optionally a number n can be specified so that the filename is printed left-justified in n spaces. |
L | Linefeed/carriage-return (more than one footing line). |
PN | Print page number. |
P | Print page number right-justified in 4 spaces. |
Pn | Print page number left-justified in n spaces. |
T | Print current time and date i.e. 12:11:16 16 FEB 1994. |
FOOTING LLCCopyright 1998 Beauchamp Computer
Services Limited LC- PN -
Gabc
a | An optional number of fields to skip. 0 is assumed if none specified. |
b | The character (excluding the minus sign, attribute, value, and subvalue marks) which forms the field delimiter. |
c | The number of fields to be extracted (as delimited by b). |
G*1 | outputs USERNAME (extract all characters from the beginning of the string up to the first asterisk). |
G1*1 | outputs 9544 (extract all characters between the first and second asterisks). |
G2*1 | outputs 32456 (extract all characters between the second and third asterisks). |
G1*2 | outputs 9544*32456 (extract all characters between the second and fourth asterisks) etc. |
>COUNT EMPLOYEES WITH PAY GE 1000.00
>COUNT EMPLOYEES WITH PAY >= 1000.00
GRAND-TOTAL text options text
U | Underlines all totalled fields with =. |
L | Suppresses the blank after the last detail-line. |
P | Prints the final total on a new page (e.g. allows meaningless final totals to be discarded). |
COUNT EMPLOYEES WITH PAY GT 999.99
COUNT EMPLOYEES WITH PAY > 999.99
B | Used with the B option of BREAK-ON to insert the break quantity in the heading. |
C | Centres the heading line. |
D | Prints current, external date ie 16 FEB 1994. |
Fn | Prints current data filename. Optionally a number n can be specified so that the filename is printed left-justified in n spaces. |
L | Linefeed/carriage-return (more than one heading line). |
PN | Print page number. |
P | Print page number right-justified in 4 spaces. |
Pn | Print page number left-justified in n spaces. |
T | Print current time and date i.e. 12:11:16 16 FEB 1994. |
HEADING CACCESS MANUALLLL
>LIST EMPLOYEES IF SURNAME = SMITH SURNAME PAY
>LIST EMPLOYEES WITH SURNAME = SMITH SURNAME PAY
>ISTAT filename itemlist criteria (options
Ln,m
n | The exact number of characters a datum must match to be listed. |
m | This optional parameter is an upper length limit and if present turns n into the lower length limit. Thus if the length of a datum falls within this inclusive range then the datum is listed. |
>COUNT EMPLOYEES WITH PAY LE 1000.00
>COUNT EMPLOYEES WITH PAY <= 1000.00
>LIST EMPLOYEES 0001 0002 0003
0004 SURNAME PAY
>LIST EMPLOYEES = 0001 OR = 0002 OR
= 0003 OR = 0004 SURNAME PAY
>LIST EMPLOYEES GE 0001 AND LE 0004
SURNAME PAY
Columns | The number of labels across each page. |
Rows | The number of lines to be printed per label. |
Skip | The number of lines between labels. |
Indent | The number of spaces in the left margin. |
Size | The number of characters per label line. |
Space | The number of characters between labels. |
C | Optional. Used to compress null values. |
>LIST-LABEL CUSTOMERS NAME ADDR1 ADDR2 ADDR3 ADDR4 POSTCODE
(IC ?3,6,3,0,40,1
>COUNT EMPLOYEES WITH PAY LT 1000.00
>COUNT EMPLOYEES WITH PAY < 1000.00
The MV Basics guide to the Access Query Language will continue in the Spring 1999 edition of MultiValue News
MV Basics: The Access Query Language - Part 4
Last Updated: 20 July 1999