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.
I have the following code and I'm receiving a FOC295 error(Value missing for & var). I can't understand why, because this code was copied from a statement that IS working and is identical except for variable names. The only other difference is that the code that works only has 1 variable, and this statement has 2. However, when I take the second one out, I still get errors.
TABLE FILE PRTY_RLTSHP_TYP_T PRINT PRTY_RLTSHP_TYP_ID RLTSHP_TYP_DESC WHERE RLTSHP_TYP_NM = 'FROM A SUPERVISOR TO A SUBORDINANT' ON TABLE SAVE AS RLTSHPFLAG END -RUN -READ RLTSHPFLAG,&&SUP_SUB_RLTSHP_TYP,&&SUP_SUB_RLTSHP_DESC -TYPE &&SUP_SUB_RLTSHP_TYP,&&SUP_SUB_RLTSHP_DESCThis message has been edited. Last edited by: Kerry,
WebFOCUS: 7702 O/S : Windows Data Migrator: 7702
Posts: 127 | Location: San Antonio | Registered: May 29, 2009
It's usually advisable to initialize your variables before attempting to use them. That way, if the -READ statement fails for whatever reason your &variables will still exist and contain whatever default values you assigned to them before. You could then test those variables and determine if your process indeed worked as expected.
Try this and see if it helps:
-SET &&SUP_SUB_RLTSHP_TYP='NONE';
-SET &&SUP_SUB_RLTSHP_DESC='NONE';
-*
TABLE FILE PRTY_RLTSHP_TYP_T
PRINT PRTY_RLTSHP_TYP_ID
RLTSHP_TYP_DESC
WHERE RLTSHP_TYP_NM = 'FROM A SUPERVISOR TO A SUBORDINANT'
ON TABLE SAVE AS RLTSHPFLAG
END
-RUN
-READ RLTSHPFLAG,&&SUP_SUB_RLTSHP_TYP,&&SUP_SUB_RLTSHP_DESC
-TYPE &&SUP_SUB_RLTSHP_TYP,&&SUP_SUB_RLTSHP_DESC
-*
-IF &&SUP_SUB_RLTSHP_TYP NE 'NONE' AND &&SUP_SUB_RLTSHP_DESC NE 'NONE' THEN GOTO :ALLGOOD;
-TYPE Oops. Something failed!
-EXIT
-*
-:ALLGOOD
-TYPE Looking good ....
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
Sorry, neither of these helped, although nj, your -SET idea was prudent.
I keep seeing this in the log:
0 FIELDNAME ALIAS FORMAT LENGTH
06/25/2010 15:18:31 DEV_DM PRTY_RLTSHP_TYP_ID PRTY_RLTSHP_> I11 11
06/25/2010 15:18:31 DEV_DM RLTSHP_TYP_NM RLTSHP_TYP_N> A40V 46
06/25/2010 15:18:31 DEV_DM TOTAL 57
06/25/2010 15:18:31 DEV_DM 0 ERROR AT OR NEAR LINE 76 IN PROCEDURE __WCFEX FOCEXEC *
06/25/2010 15:18:31 DEV_DM (FOC295) A VALUE IS MISSING FOR: &&SUP_SUB_RLTSHP_TYP
The format of the '_NM' field is A40V, so I dont know why the procedure thinks it's 46 in length. Could an overflow be the problem?
WebFOCUS: 7702 O/S : Windows Data Migrator: 7702
Posts: 127 | Location: San Antonio | Registered: May 29, 2009
Anything that is an AnV format inserts the length of the field in the first six positions (like 000100) for an AnV value that is 100 characters long. so an A40V would be 46 characters long.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
As your field is defined as variable-length (A40V), 40 characters are used to represent the actual content of the field and 6 are used to establish its value's length. For instance, a value of 'SUPERVISOR' would be seen as:
000010SUPERVISOR
000010 --> 10 characters in 'SUPERVISOR'
To avoid that extra piece in your file, you may want to DEFINE a new field as A40 and PRINT that instead of the original A40V.
Incorporating Darin's very important observation about -READ you could try something like:
-SET &&SUP_SUB_RLTSHP_TYP = 'NONE';
-SET &&SUP_SUB_RLTSHP_DESC = 'NONE';
-*
DEFINE FILE PRTY_RLTSHP_TYP_T
NEW_RLTSHP_TYP_DESC/A40 = RLTSHP_TYP_DESC;
END
TABLE FILE PRTY_RLTSHP_TYP_T
PRINT PRTY_RLTSHP_TYP_ID
NEW_RLTSHP_TYP_DESC
WHERE RLTSHP_TYP_NM = 'FROM A SUPERVISOR TO A SUBORDINANT'
ON TABLE SAVE AS RLTSHPFLAG
END
-RUN
-READ RLTSHPFLAG &&SUP_SUB_RLTSHP_TYP.A11. &&SUP_SUB_RLTSHP_DESC.A40.
-TYPE &&SUP_SUB_RLTSHP_TYP, &&SUP_SUB_RLTSHP_DESC
-*
-IF &&SUP_SUB_RLTSHP_TYP NE 'NONE' AND &&SUP_SUB_RLTSHP_DESC NE 'NONE' THEN GOTO :ALLGOOD;
-TYPE Oops. Something failed!
-EXIT
-*
-:ALLGOOD
-TYPE Looking good ....
This message has been edited. Last edited by: njsden,
As stated, avoid variable length fields in your hold file. Darin said:
quote:
Use the correct syntax for the -READ
And I agree with that partly. Actually this syntax for the -READ is correct, but your file has to be comma delimited for the command to come up with the correct results. Your dtaa file is not comma delimited, so you may get the strangest results. This is the actual reason for your error message. It can be solved as posted in the previous entry.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
Well, I'm no longer receiving an ERROR, but the define field is stil not being populated correctly. GamP, you mention something about this having to be a comma-delimited file? This is a DB2 file...how would I get that to work? I have no way to make anything other than DB2.
Here is what I have after your suggestions:
-SET &&SUP_SUB_RLTSHP_TYP='NONE';
-SET &&SUP_SUB_RLTSHP_NM='NONE';
-*
DEFINE FILE PRTY_RLTSHP_TYP_T
PRINT_NM/A40 = RLTSHP_TYP_NM;
END
TABLE FILE PRTY_RLTSHP_TYP_T
PRINT PRTY_RLTSHP_TYP_ID
PRINT_NM
WHERE RLTSHP_TYP_NM = 'SUPERVISOR TO EMPLOYEE RELATIONSHIP'
ON TABLE SAVE AS RLTSHPFLAG
END
-RUN
-READ RLTSHPFLAG &&SUP_SUB_RLTSHP_TYP.A11. &&SUP_SUB_RLTSHP_NM.A40.
-TYPE &&SUP_SUB_RLTSHP_TYP, &&SUP_SUB_RLTSHP_NM
-*
-IF &&SUP_SUB_RLTSHP_TYP NE 'NONE' AND &&SUP_SUB_RLTSHP_NM NE 'NONE' THEN GOTO :ALLGOOD;
-TYPE Oops. Something failed!
-EXIT
-*
-:ALLGOOD
-TYPE Looking good ....
WebFOCUS: 7702 O/S : Windows Data Migrator: 7702
Posts: 127 | Location: San Antonio | Registered: May 29, 2009
i.e. with commas in the command, then this means you wish to read from a comma delimited input file. In your case this would then have been the result of the TABLE command, so ON TABLE HOLD AS RLTSHPFLAG FORMAT COMMA. If you do not hold as a comma delimited file, then use -READ RLTSHPFLAG &&SUP_SUB_RLTSHP_TYP.A11. &&SUP_SUB_RLTSHP_NM.A40. So your code in the last entry should be correct. Tip: it might be wise to not do a SAVE but a HOLD for once, so you can have a look at the master file that is being generated. It may be so that the hold file does not contain exactly the thing that you think it contains. So after holding the data, you could do a TABLE FILE RLTSHPFLAG PRINT * END to see what's actually in the hold file.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
GamP, when I do the table HOLD and display the output, everything comes back exactly how I want. However, when I take the "TABLE FILE RLTSHPFLAG PRINT * END" code out, I get problems again. It appears now that the NM field is not even being recognized. I see in the log window that the ID field was queried and returned, but no indication that the NM was even processed.
WebFOCUS: 7702 O/S : Windows Data Migrator: 7702
Posts: 127 | Location: San Antonio | Registered: May 29, 2009
Have you checked the format and length of the fields in the SAVE or HOLD file? If you do a HOLD file, you can use ?FF holdname.
TABLE FILE CAR
SUM SALES
BY COUNTRY
BY CAR
ON TABLE HOLD
END
-RUN
?FF HOLD
0 NUMBER OF RECORDS IN TABLE= 18 LINES= 10
FILENAME= HOLD
COUNTRY E01 A10
CAR E02 A16
SALES E03 I6
If you use SAVE with the code above, you would see something like this in the source or html page.
0 NUMBER OF RECORDS IN TABLE= 18 LINES= 10
ALPHANUMERIC RECORD NAMED SAVE
0 FIELDNAME ALIAS FORMAT LENGTH
COUNTRY COUNTRY A10 10
CAR CARS A16 16
SALES UNITS I6 6
TOTAL 32
I use these all the time to be sure I'm reading and getting the right values when I use -READ.
Cheers, Mika
WebFOCUS 7.6.x PMF 5.2.x
Posts: 58 | Location: Sydney, Australia | Registered: April 22, 2005