[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference ilbbak::ibi_focus

Title:FOCUS, from INFORMATION BUILDERS
Moderator:ZAYIUS::BROUILLETTE
Created:Thu Feb 19 1987
Last Modified:Mon May 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:615
Total number of notes:1779

446.0. "Getting the value of TABPAGENO" by KAHALA::FOREMAN () Wed Aug 07 1991 13:28

    I am appending 2 reports together and would like the page numbering on
    the second "half" of the report pick up where the first "half" left
    off.  Is there any way to extract the value of TABPAGENO at the end of
    the first hold file and use it to begin numbering the pages of the
    second ?
    
    It sounds like it should be simple, but I can't find it anywhere in
    the manuals.  By the way we are running V6.0 here.
    
    Thanx for any help you can give,
    
    Sharon
T.RTitleUserPersonal
Name
DateLines
446.1Impossible ???KAHALA::FOREMANNothings Impossible, you just run out of timeFri Aug 30 1991 17:085
    I assume No_News = No_Can_Do here.
    
    Guess I'm in the Outer Limits of 4GL land again.
    
    Sharon
446.2back from the Outer LimitsMILPND::MADDENWed Sep 18 1991 14:3412
    Since I just returned from the Outer Limits, I would try this.
    After the first table &LINES contains the number of lines in the
    report.  ( If the second report is in a second procedure you'll have to 
    save &LINES in a &&var) .  Divide &&LINES by the num. of lines per
    page, say 60. (remember the SET LINES command) and you have the last 
    page num, say &&PAGE_NUM.  In the second report DEFINE PAGE_NUM/P5=
    TABPAGENO + &&PAGE_NUM;   Use the page_num field in the footing etc.
    
    	I don't guarantee the above cause I never did it before. I made
    it up based on my limited knowledge and experience. 
    
    Richard
446.3Almost worked ...KAHALA::FOREMANNothings Impossible, you just run out of timeFri Sep 20 1991 16:3515
    re : .2
    
    Well, guess I'm heading back out again.  Setting the &&PAGE_NUM
    variable works fine, but Defining the new PAGE_NUM field for the
    next procedure doesn't work.  Doesn't seem to like the TABPAGENO
    or understand what it is.  It appears TABPAGENO is only recognized
    after you make your TABLE FILE filename statement.  Tried to
    do a few things within the TABLE request, like using 
    "<1 PAGE: <7 &&PAGE_NUM + TABPAGENO" in my Heading to no avail.
    So, if you're in the mood for a challenge again - feel free to
    suggest any other things I might try.
    
    Thanx again,
    
    Sharon
446.4getting close??MILPND::MADDENMon Sep 23 1991 17:368
    how about in the DEFINE ...PAGE_NUM=&&PAGE_NUM;  
    in the TABLE .......AND COMPUTE DPAGE_NUM=LST.PAGE_NUM+TABPAGENO; NOPRINT
    FOOTING
    "page <DPAGE_NUM"
    
    With a little fine tuning hopefully this will give you something - to
    work with.  
    -Richard
446.5Almost there...RDGE44::KEEGAN_9Tue Sep 24 1991 04:3135
    Hi guys,
    
    The following works - BUT you have to know how many PRINTED lines, in
    terms of data lines (without headings/footings/etc) are on each page of
    the first report.
    
    In the case below, the default was 21 lines (HotScreen), but 16 records
    appeared on each page, hence the usage of 16.
    
	TABLE FILE INVOICE
	HEADING
	"REP 1:PAGE <TABPAGENO"
	PRINT INV_DEC_NO AND INV_AR_NO AND INV_CCYYMMDD
	END
	-RUN
	-SET &REX = &LINES;
	TABLE FILE INVOICE 
	HEADING
	"REP 2:PAGE <NEW_PAGE"
    	PRINT INV_DEC_NO AND TABPAGENO NOPRINT
    	AND COMPUTE
	NEW_PAGE/I6 = IF (&REX/16) EQ INT(&REX/16)
                      THEN TABPAGENO+1+(&REX/16)
              	      ELSE TABPAGENO+2+(&REX/16); NOPRINT
	BY INV_DATE
	END

    
    Hope this isn't too late.
    
    
    Regards,
    
    Paul K	
          
446.6It must be me - nah !!!KAHALA::FOREMANNothings Impossible, you just run out of timeTue Sep 24 1991 12:26142
    RE: .5 - OK, I give up ???  I can't seem to get the logic you suggest
    to work.  I am attaching a log of the error I'm getting.  Maybe you can
    figure out what I'm doing wrong!  You really got this to work, right ?
    
    
    %SET-W-NOTSET, error modifying HSC013$DUA115:
-CLI-E-IVDEVTYPE, invalid device type - specify a mailbox device
$!
$ DEFINE FOC$DIR1 DSS_MAS
$!
$ FOCUS
FOCUS 6.1.0    (C)Copyright 1990 Information Builders Inc.
Licensed for Digital Internal  Administrative  Use (A87110072)
 
EX [FOREMAN]DSS013.FEX ECHO=ALL
>
-*******************************************************************************
-*****************************Digital Equipment Corp.***************************
-*******************************************************************************
-*
-* APPLICATION SYSTEM NAME    : DSS (DECISION SUPPORT SYSTEMS)
-*
-* PROGRAM NAME               : DSS013.FEX
-*
-*******************************************************************************
SET NODATA = '???'
SET LINES  = 60
SET WIDTH  = 132
SET PANEL  = 132
USE
DSS_DATA:DSS1008.FOC AS DSS1008
END
FILEDEF OUTFILE1 DISK DSS_WORK:DSS20032.0AW
FILEDEF OUTFILE2 DISK DSS_WORK:DSS20045.0AW
-RUN
>>>>>>>>-DEFAULTS &DSPS_DT=XXXXXXXXXXX XX:XX:XX.XX, &AVAIL_DT=XXXXXXXXXXX XX:XX:XX.XX
-READ OUTFILE1 &DSPS_DT.A23.
-READ OUTFILE2 &AVAIL_DT.A23.
DEFINE FILE DSS1008
OOSMSG/A12   = IF OOS_IND EQ 'Y' THEN 'OUT OF STOCK' ELSE ' ';
NFLMSG/A5    = IF NFL_IND EQ 'Y' THEN '  NFL' ELSE ' ';
OOSCNT/I6    = IF OOS_IND EQ 'Y' THEN 1 ELSE 0;
NFLCNT/I6    = IF NFL_IND EQ 'Y' THEN 1 ELSE 0;
PARTCNT/I6   = 1;
MENU/I6      = IF IPCC_IND NE 'Y' AND NFL_IND NE 'Y' THEN 1 ELSE 0;
AVAIL/I6     = IF IPCC_IND NE 'Y' AND NFL_IND NE 'Y' AND OOS_IND NE 'Y' THEN 1
                  ELSE 0;
SEGMENT/A5   = IF SEG_TYPE EQ 'OP' OR 'PV' THEN 'OP/PV' ELSE
               IF SEG_TYPE EQ 'PC' OR 'SU' THEN 'SU/PC' ELSE SEG_TYPE;
CLASS/A2     = EDIT(PART_NUMBER, '99');
HYPHEN1/A1   = IF CLASS EQ '  ' THEN ' ' ELSE '-';
BASIC/A5     = EDIT(PART_NUMBER, '$$99999');
VARIANT/A2   = EDIT(PART_NUMBER, '$$$$$$$99');
HYPHEN2/A1   = IF VARIANT EQ '  ' THEN ' ' ELSE '-';
FORMAT_PART/A11 = CLASS||HYPHEN1||BASIC||HYPHEN2||VARIANT;
END
-RUN
>>-* START OF DOMESTIC PART STATUS REPORT (DSS20050.0AP)
TABLE FILE DSS1008
HEADING
"<1 DSS20050.0AP <56 FASTSHIP MENU SYSTEM <114 09/24/91 11.13.40 "
"<1 PAGE: <7 <TABPAGENO <53 DOMESTIC PART STATUS REPORT </1"
"<40 ----------------------------------------------------"
"<40 | DSPS PRODUCT FILE AS OF: 24-SEP-1991 05:41:46.45 |"
"<40 | AVAILABILITY FILE AS OF: 24-SEP-1991 07:55:52.82 |"
"<40 ---------------------------------------------------- </2"
PRINT FORMAT_PART AS ' PART,NUMBER '          IN 10
      OOSMSG      AS 'OUT OF STOCK,  MESSAGE' IN 26
      NFLMSG      AS '  NFL,MESSAGE'          IN 43
      LEAD_TIME   AS 'LEAD,TIME'              IN 55
      SHIP_LOC    AS 'SHIP,LOC'               IN 64
      SEG_TYPE    AS 'SEGMENT, TYPE'          IN 73
      MAX_ORD_QTY AS 'MOQ'                    IN 85
      ONHAND_QTY  AS 'ONHAND, QTY'            IN 98
      AVAIL_QTY   AS 'AVAIL, QTY'             IN 112
IF MENU_TYPE EQ 'B' OR 'D'
IF PART_STAT EQ 'A' OR 'R'
IF IP_IND    EQ 'N'
ON TABLE HOLD AS D20050_A FORMAT DOC
END
-RUN
>
 MERGE:   RECORDS=     2000 LINES=     2000
 
 MERGE:   RECORDS=     2244 LINES=     2244
 
 NUMBER OF RECORDS IN TABLE=     2244  LINES=     2244  PRINT WIDTH=  122
 
 
 HOLDING... FORMAT DOC
 
 
>-SET &REX =      2244;
TABLE FILE DSS1008
HEADING
"<1 DSS20050.0AP <56 FASTSHIP MENU SYSTEM <114 09/24/91 11.13.40 "
"<1 PAGE: <7 <NEW_PAGE <53 DOMESTIC PART STATUS REPORT </1" <----- Line 80 ---|
"<40 ----------------------------------------------------"                    |
"<40 | DSPS PRODUCT FILE AS OF: 24-SEP-1991 05:41:46.45 |"                    |
"<40 | AVAILABILITY FILE AS OF: 24-SEP-1991 07:55:52.82 |"                    |
"<40 ---------------------------------------------------- </2"                |
SUM  SEGMENT         AS 'SEGMENT TYPE'   IN 32                                |
     PARTCNT         AS 'PROGRAM'        IN 49                                |
     MENU            AS 'ON MENU'        IN 61                                |
     AVAIL           AS 'AVAILABLE'      IN 74                                |
     LST.TABPAGENO   NOPRINT                                                  |
BY   SEGMENT NOPRINT                                                          |
AND  COMPUTE                                                                  |
     PERCENT/D6.2 = C4 / C2 *100; AS '% AVAILABLE' IN 88                      |
AND  COMPUTE                                                                  |
     NEW_PAGE/I6  = IF (     2244/46) EQ INT(     2244/46)                    |
                    THEN TABPAGENO+1+(     2244/46)                           |
                    ELSE TABPAGENO+2+(     2244/46); NOPRINT                  |
ON TABLE RECAP                                                                |
   TOT_PCT/D6.2 = C4 / C2 *100;                                               |
ON TABLE SUBFOOT                                                              |
"</2 <32 TOTAL <50 <TOT.PARTCNT <62 <TOT.MENU  <77 <TOT.AVAIL <93 <TOT_PCT"   |
"</2 <32 TOTAL OUT OF STOCK     = <TOT.OOSCNT"                                |
"<32 TOTAL NON F LEAD TIMES = <TOT.NFLCNT"                                    |
IF MENU_TYPE EQ 'B' OR 'D'                                                    |
IF PART_STAT EQ 'A' OR 'R'                                                    |
IF IP_IND    EQ 'N'                                                           | 
ON TABLE HOLD AS D20050_B FORMAT DOC                                          |
END                                                                           |
-RUN                                                                          |
>                                                                             |
 ERROR AT OR NEAR LINE   80 IN PROCEDURE DISK$DSS_USER1:[FOREMAN]DSS013.FEX --|
 
(FOC406) FIELDNAME IS NOT RECOGNIZED : NEW_PAGE
 BYPASSING TO END OF COMMAND
FIN
 
 
(FOC009) INCOMPLETE REQUEST STATEMENT
$ EXIT
  FOREMAN      job terminated at 24-SEP-1991 11:13:55.21

  Accounting information:
  Buffered I/O count:             221         Peak working set size:    3122
  Direct I/O count:               273         Peak page file size:     18488
  Page faults:                   3387         Mounted volumes:             0
  Charged CPU time:           0 00:00:10.42   Elapsed time:     0 00:00:26.30
    
446.7Readability - pah !!!RDGE44::KEEGAN_9Wed Sep 25 1991 03:4114
    I'm sooooooooooooooooo sorry! You wouldn't believe how long I took to
    make sure the code worked (but don't quote me)!!
    
    The last thing I did before replying to this note was to put the HEADING 
    code at the top of the TABLE request - for readability. This, however, 
    uses the COMPUTED field before it has been COMPUTEd. 
    
    Try your code again with the HEADING lines after the compute. I promise 
    that my version DOES work now.
    
    
    Sorry again,
    
    Paul.
446.8It works - thanx all !!KAHALA::FOREMANNothings Impossible, you just run out of timeWed Sep 25 1991 15:1156
Paul,
    
    Thanx - moving the heading after the compute works like a charm. I
    have 2 "addendums" so I modified your example a little to get the
    number of pages on each section prior to the TABLE file request,
    and then just add that to the TABPAGENO value.  ( Kind of a combination
    of what Richard suggested in (.4) and your (.5) solution ). This fixed
    a problem I was having on the 3rd report numbering.  If the value
    of (&REX2/39) was <1 (0.something), There was 1 page on the report,
    but only a value of 0 was being added to the TABPAGENO.  My initial
    solution was to force the &REX2 value to a minimum of 39, but thought
    this was a little cleaner. Thanx again for all your help.  Bet you'll
    think twice before responding to one of these questions again !
    
    Sharon
    
    My version below ....
    
	TABLE FILE INVOICE
	HEADING
	"REP 1:PAGE <TABPAGENO"
	PRINT INV_DEC_NO AND INV_AR_NO AND INV_CCYYMMDD
	END
	-RUN

	-* FIRST REPORT CONTAINS MAXIMUM 46 DETAIL LINES PER PAGE
	-SET &REX = &LINES;
        -SET &NUM_PGSA = IF (&REX/46) EQ INT(&REX/46)
        -                THEN INT(&REX/46)
        -                ELSE (INT(&REX/46) + 1);

	TABLE FILE INVOICE 
    	PRINT INV_DEC_NO AND TABPAGENO NOPRINT
    	AND COMPUTE
	NEW_PAGE/I6 = TABPAGENO+1+(&NUM_PGSA); NOPRINT
	BY INV_DATE
	HEADING
	"REP 2:PAGE <NEW_PAGE"
	END
	-RUN

	-* SECOND REPORT CONTAINS MAXIMUM 39 DETAIL LINES PER PAGE
	-SET &REX2 = &LINES;
        -SET &NUM_PGSB = IF (&REX2/39) EQ INT(&REX2/39)
        -                THEN INT(&REX2/39)
        -                ELSE (INT(&REX2/39) + 1);

	TABLE FILE INVOICE 
    	PRINT INV_AR_NO AND TABPAGENO NOPRINT
    	AND COMPUTE
	NEW_PAGE2/I6 = TABPAGENO+1+(&NUM_PGSA+&NUM_PGSB); NOPRINT
	BY INV_DATE
	HEADING
	"REP 3:PAGE <NEW_PAGE2"
	END
	-RUN
446.9TABPAGENO New FeatureMILPND::MADDENThu Sep 26 1991 10:415
    
    	This is great!!  Now we have a TABPAGENO New Feature with a
    documented example.  And so easy to find with a DIR/TITLE=
    Thank you
    Richard