Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Error on Reading a File

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Error on Reading a File
 Login/Join
 
Platinum Member
posted
I am reading a file into an amper vaiable that consists of one decimal formatted field. I am getting a syntax error on reading the field. A snippet of the code and the error is below. I may be overlooking something.

   
TABLE FILE MDM_READINGS
PRINT MIN_KW_DEM 
BY LOWEST 1 MIN_KW_DEM NOPRINT
WHERE AMI_METER_ID EQ '&METER';
WHERE d_st_date_cvte_hmdyy GE '&ST_DT';
WHERE d_end_date_cvte_hmdyy LE '&END_DT';
WHERE CHANNEL EQ '&KW_CHANNEL';
WHERE UNIT_OF_MEASURE CONTAINS 'KWH';
WHERE MIN_KW_DEM GT &MIN_KW_THRSH;
ON TABLE SAVE AS HOLDA FORMAT ALPHA
END
-RUN


-SET &MIN_KW_DEM = '';
-BEGIN
-READ HOLDA &MIN_KW_DEM.D20.2.
-TYPE &MIN_KW_DEM
-DONE
-EXIT



Error:
0 NUMBER OF RECORDS IN TABLE= 30 LINES= 1
0 ERROR AT OR NEAR LINE 86 IN PROCEDURE ADHOCRQ
(FOC224) SYNTAX ERROR: D12
------------------------vvv
-READ HOLDA &MIN_KW_DEM.D12.2.

This message has been edited. Last edited by: FP Mod Chuck,


WF 8.1.05
Windows
SQL Server 2014
HTML, PDF, EXCEL
 
Posts: 175 | Registered: March 24, 2017Report This Post
Silver Member
posted Hide Post
Not seeing anything that stands out, but personally I've had more luck with -READFILE than having to identify the formats with the -READ.


WF Version 8105
 
Posts: 45 | Registered: October 07, 2015Report This Post
Virtuoso
posted Hide Post
Try using that syntax
SET ASNAMES = ON
TABLE FILE SALES
SUM RETAIL_PRICE AS 'TOT_SALES'
ON TABLE HOLD AS EXT
END
-RUN

-READFILE EXT
-TYPE &TOT_SALES

Using READFILE you don't have to bother about format

This message has been edited. Last edited by: MartinY,


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Platinum Member
posted Hide Post
Yeah, I normally have more luck with -READFILE also. I had already tried it and I really get the same error:

0 NUMBER OF RECORDS IN TABLE= 1 LINES= 1
ALPHANUMERIC RECORD NAMED HOLDA
0 FIELDNAME ALIAS FORMAT LENGTH
MIN_KW_DEM D12.2 12
RNK$$00102 I6 6
TOTAL 18
1
0 NUMBER OF RECORDS IN TABLE= 30 LINES= 1
0 ERROR AT OR NEAR LINE 86 IN PROCEDURE ADHOCRQ
(FOC224) SYNTAX ERROR: &MIN_KW_DEM
----------------vvvvvvvvvvv
-READFILE HOLDA &MIN_KW_DEM


WF 8.1.05
Windows
SQL Server 2014
HTML, PDF, EXCEL
 
Posts: 175 | Registered: March 24, 2017Report This Post
Platinum Member
posted Hide Post
MartinY - I tried using the actual syntax you posted and it worked. I have it below. Thanks for your help and thanks to the other individuals for helping out on this thread.

TABLE FILE MDM_READINGS
PRINT MIN_KW_DEM
BY LOWEST 1 MIN_KW_DEM NOPRINT
WHERE AMI_METER_ID EQ '&METER';
WHERE d_st_date_cvte_hmdyy GE '&ST_DT';
WHERE d_end_date_cvte_hmdyy LE '&END_DT';
WHERE CHANNEL EQ '&KW_CHANNEL';
WHERE UNIT_OF_MEASURE CONTAINS 'KWH';
WHERE MIN_KW_DEM GT &MIN_KW_THRSH;
ON TABLE HOLD AS HOLDA
END
-RUN


-SET &MIN_KW_DEM = '';
-BEGIN
-READFILE HOLDA
-TYPE &MIN_KW_DEM
-DONE
-EXIT


WF 8.1.05
Windows
SQL Server 2014
HTML, PDF, EXCEL
 
Posts: 175 | Registered: March 24, 2017Report This Post
Platinum Member
posted Hide Post
[Solved]Originally posted by AMC:
I am reading a file into an amper vaiable that consists of one decimal formatted field. I am getting a syntax error on reading the field. A snippet of the code and the error is below. I may be overlooking something.

   
TABLE FILE MDM_READINGS
PRINT MIN_KW_DEM 
BY LOWEST 1 MIN_KW_DEM NOPRINT
WHERE AMI_METER_ID EQ '&METER';
WHERE d_st_date_cvte_hmdyy GE '&ST_DT';
WHERE d_end_date_cvte_hmdyy LE '&END_DT';
WHERE CHANNEL EQ '&KW_CHANNEL';
WHERE UNIT_OF_MEASURE CONTAINS 'KWH';
WHERE MIN_KW_DEM GT &MIN_KW_THRSH;
ON TABLE SAVE AS HOLDA FORMAT ALPHA
END
-RUN


-SET &MIN_KW_DEM = '';
-BEGIN
-READ HOLDA &MIN_KW_DEM.D20.2.
-TYPE &MIN_KW_DEM
-DONE
-EXIT



Error:
0 NUMBER OF RECORDS IN TABLE= 30 LINES= 1
0 ERROR AT OR NEAR LINE 86 IN PROCEDURE ADHOCRQ
(FOC224) SYNTAX ERROR: D12
------------------------vvv
-READ HOLDA &MIN_KW_DEM.D12.2.[/QUOTE]


WF 8.1.05
Windows
SQL Server 2014
HTML, PDF, EXCEL
 
Posts: 175 | Registered: March 24, 2017Report This Post
Expert
posted Hide Post
The only valid READ formats are alpha and integer. Hence D12.2 is invalid.

e.g. -READ filename &variable.A8.
or -READ filename &variable.I8.

There should be a period before and after the format attribute.

As Martyn suggests, using -READFILE is a much better method as it will use both the filednames as the variable names plus the formats.

If you wish to use decimals within dialogue manager, you should also consider using SET DMPRECISION = n.


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
This is a link to some documentation.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Error on Reading a File

Copyright © 1996-2020 Information Builders