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 think I must be missing something obvious. I have a number of records in the NATNONPART file. Some are alpha numeric but some are numeric. The numeric ones for example are partial part numbers where I need to find all the full part numbers which contains that partial part number. Some of the values in this file are already the full part number. When running this code, it works fine for the part numbers which are alpha numeric, however it's not working for the partial number which happen to have no alpha character. I've tried various ways to evaluate the variable and converting it but it doesn't seem to be working or I'm doing something wrong (and yes the latter is the most likely)
TABLE FILE NATNONPART
SUM
PART_NUM/A25 AS 'NATPART'
BY PART_NUM NOPRINT
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS NATNONPART0 FORMAT ALPHA
-*ON TABLE PCHOLD FORMAT XLSX
END
FILEDEF NATNONPARTS DISK NATNONPARTS
-SET &NEWLINES01=&LINES;
-SET &NATPART = ' ';
-REPEAT LOOPCODE &LINES TIMES;
-READ NATNONPART0 NOCLOSE &NATPART.A25.
-IF &IORETURN NE 0 GOTO OUTLOOP;
-SET &PART_NUM1 = &NATPART;
-RUN
FILEDEF NATNONPARTS DISK NATNONPARTS (APPEND
-RUN
TABLE FILE V9F4101
PRINT
A_2ND_ITEM_NUMBER AS '2NDITEMS'
BY A_2ND_ITEM_NUMBER NOPRINT
WHERE A_2ND_ITEM_NUMBER CONTAINS '&PART_NUM1';
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS NATNONPARTS FORMAT ALPHA
-*ON TABLE PCHOLD FORMAT XLSX
END
-RUN
-SET &NATPART = ' ';
-LOOPCODE
-OUTLOOP
Any help is appreciated.This message has been edited. Last edited by: rogerwilkouk,
The set Echo shows that the value is correct and when I use the exact same syntax but passing the value from the Echo directly (hard code it into the contains), it all works fine.
TABLE FILE NATNONPART
SUM PART_NUM/A25 AS 'NATPART'
BY PART_NUM NOPRINT
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS NATNONPART0
END
-RUN
-SET &NEWLINES01=&LINES;
FILEDEF NATNONPARTS DISK NATNONPARTS
-REPEAT LOOPCODE &NEWLINES01 TIMES;
-READFILE NATNONPART0
-RUN
-SET &PART_NUM1 = &NATPART;
FILEDEF NATNONPARTS DISK NATNONPARTS (APPEND
-RUN
TABLE FILE V9F4101
PRINT A_2ND_ITEM_NUMBER AS '2NDITEMS'
BY A_2ND_ITEM_NUMBER NOPRINT
WHERE A_2ND_ITEM_NUMBER CONTAINS &PART_NUM1.QUOTEDSTRING;
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS NATNONPARTS FORMAT ALPHA
END
-RUN
-LOOPCODE
I know that it works by using below sample:
TABLE FILE CAR
BY MODEL/A7 AS 'NATPART'
WHERE READLIMIT EQ 5;
WHERE RECORDLIMIT EQ 5;
ON TABLE HOLD AS NATNONPART0
END
-RUN
-SET &NEWLINES01=&LINES;
-DEFAULTH &NATPART = ''
FILEDEF NATNONPARTS DISK NATNONPARTS
-REPEAT LOOPCODE &NEWLINES01 TIMES;
-READFILE NATNONPART0
-RUN
-SET &PART_NUM1 = &NATPART;
FILEDEF NATNONPARTS DISK NATNONPARTS (APPEND
-RUN
TABLE FILE CAR
PRINT MODEL AS '2NDITEMS'
BY CAR NOPRINT
WHERE MODEL CONTAINS &PART_NUM1.QUOTEDSTRING;
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS NATNONPARTS FORMAT ALPHA
END
-RUN
-LOOPCODE
TABLE FILE NATNONPARTS
PRINT *
END
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, 2013