I'm using the IN FILE statement in the following dialogue manager -IF statement but I'm getting the error message "INPUT FILE NOT ALLOCATED." I have an APP HOLD foldername statement in the fex also. I need to compare the value passed in the &FILENO parameter to the fileno in the BESTCUST file. Thanks.
-IF &FILENO IN FILE BESTCUST GOTO SECTION1 ELSE GOTO SECTION2;
WF 8009 Windows 7This message has been edited. Last edited by: Michele Brooks,
WF 8205, Windows 10 Oracle DBMS EXL07/PDF Output
March 07, 2017, 10:37 AM
FP Mod Chuck
Hi Michele
You will need to put a FILEDEF command in to allocate the BESTCUST file. An example is below.
FILEDEF BESTCUST DISK baseapp/bestcust.ftm
Hope that helps
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
March 07, 2017, 10:47 AM
Michele Brooks
I do have the following filedef in the fex.
FILEDEF BESTCUST DISK "E:/ibi/apps/prod_workarea_ar/bestcust.ftm"
WF 8205, Windows 10 Oracle DBMS EXL07/PDF Output
March 07, 2017, 10:55 AM
FP Mod Chuck
Hi Michele
Try putting a -RUN after the FILEDEF
Regards
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
March 07, 2017, 11:10 AM
Francis Mariani
You cannot use IN FILE in a Dialogue Manager IF statement to test for values in a file - an IF statement will not read a file.
You will have to -READ or -READFILE each row into variables, then test the variables.
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
March 07, 2017, 11:32 AM
Michele Brooks
Thanks so much Chuck, the -RUN worked. The fex is going to the correct label.
Francis, the -IF worked. I'm reading a parameter value that is being passed via a -DEFAULT and seeing if the value is in the .ftm file that may or may not have the parameter value.
I'll close the post.
WF 8205, Windows 10 Oracle DBMS EXL07/PDF Output
March 07, 2017, 11:36 AM
Francis Mariani
Either I have completely forgotten that IN FILE works or I never knew!
Michelle, thanks for (re)educating me!This message has been edited. Last edited by: Francis Mariani,
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
March 07, 2017, 12:00 PM
Michele Brooks
Try this and let me know if it works.
-SET &ECHO = ALL;
-DEFAULT &TYPECAR = 'DATSUN';
APP HOLD prod_workarea_ar
FILEDEF CARFILE DISK "E:/ibi/apps/prod_workarea_ar/carfile.ftm"
-RUN
TABLE FILE CAR
PRINT CAR
WHERE CAR EQ 'DATSUN' OR 'JENSEN' OR 'JAGUAR'
ON TABLE HOLD AS CARFILE FORMAT ALPHA
END
-IF &TYPECAR IN FILE CARFILE GOTO TYPE_SPECIFIC ELSE GOTO TYPE_ALLCARS;
-TYPE_SPECIFIC
TABLE FILE CAR
"&TYPECAR Cars"
""
""
PRINT *
WHERE CAR EQ '&TYPECAR'
END
-GOTO ENDRPT
-TYPE_ALLCARS
TABLE FILE CAR
"All Cars"
""
""
PRINT *
WHERE CAR NE '&TYPECAR'
END
-GOTO ENDRPT
-ENDRPT
-EXIT
WF 8205, Windows 10 Oracle DBMS EXL07/PDF Output
March 07, 2017, 12:12 PM
Francis Mariani
Michelle, thanks - I did test with the CAR file and yes, it works
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
March 07, 2017, 03:53 PM
Waz
Wow, Another hidden gem undiscovered.
But is it documented ?
Quick delete your posts before someone else finds out
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
March 07, 2017, 04:05 PM
David Briars
Yep, it is in the Developing Reporting Applications manual in the 'Supplying Variable Values in an Expression' section.
The example in the manual shows it used in a -SET command: