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 am using mainframe FOCUS and encountered some strange scenarios. The data in the hold file is different from what it is displayed on the screen.
This is how my code looks:
DEFINE FILE filename
field1/i6 = 000001;
field1/i6 = IF fielda EQ LAST fielda THEN field1 ELSE field1 + 1;
field2/a6 = EDIT(field1)
field3/i3 = IF fielda EQ LAST fielda THEN field3 + 1 ELSE 1;
field4/a3 = EDIT(field3);
.
.
.
END
TABLE FILE filename
BY field1
BY field2
BY field3
BY Field4
BY fielda
BY Fieldb
.
.
END
When displaying the output on the screen, everything looks to be okay and as expected, but when the output is taken in a hold file, the values of the define field changes with no reason. Ideally there should not be any record in the output file with field1 having a values of 000001, but it do exist. I have tried holding the output in various formats, but the result remains the same - What is displayed on the screen is not same as what come in the file.
Any suggestions.
Thanks.
-ShrikantThis message has been edited. Last edited by: Kerry,
FOCUS 7.2.3 Platform: IBM system Z9 Business class O/P formats: Flat files, excel and CSV files
Posts: 39 | Location: Hyderabad, India | Registered: April 28, 2007
DEFINE FILE INFILE
CORDNO/P6 = 50099;
CORDNO/P6 = IF MPORVORDNO EQ LAST MPORVORDNO THEN CORDNO ELSE CORDNO + 1;
CORDNO/P6 = IF (CORDNO - LAST CORDNO EQ 2) THEN CORDNO -1 ELSE CORDNO;
CORDLINNO/P3 = IF MPORVORDNO EQ LAST MPORVORDNO THEN CORDLINNO + 1 ELSE 1;
LNCHECK/P5.3 = CORDLINNO/250;
CORDLINNO1/P3 = IF LNCHECK LE 1 THEN CORDLINNO ELSE 1;
CORDLINNO/P3 = IF CORDLINNO1 NE 1 THEN CORDLINNO ELSE 1;
CORDNO1/P6 = CORDNO;
CORDNO/P6 = IF CORDLINNO1 EQ 250 THEN CORDNO + 1 ELSE CORDNO;
CSORDNO/A6 = EDIT(CORDNO1);
CSORDLINNO/A3 = EDIT(CORDLINNO1);
END
TABLE FILE INFILE
BY CSORDNO
BY CSORDLINNO
BY MPORVORDNO
BY MPORVPRODNO
BY MPORVITEMNO
BY MPORVITEMNO
ON TABLE HOLD AS OUTFILE
END
-RUN
This is the output when its displayed directly on the native focus screen (without using ON TABLE HOLD AS OUTFILE):
Ideally as per the code 050099 should never occur in the output (this is what displayed on the screen), but it do exist in the hold file. The output file created here is used for further processing in the code.
This is the strange behaviour of FOCUS.
-Shrikant
FOCUS 7.2.3 Platform: IBM system Z9 Business class O/P formats: Flat files, excel and CSV files
Posts: 39 | Location: Hyderabad, India | Registered: April 28, 2007
It looks to me that you are picking up a different file than the one created by the hold. Check to see if the file is already allocated using ? TSO DDNAME OUTFILE and check it's atttributes.
DEFINE FILE INFILE CORDNO/P6 = 50099; CORDNO/P6 = IF MPORVORDNO EQ LAST MPORVORDNO THEN CORDNO ELSE CORDNO + 1; CORDNO/P6 = IF (CORDNO - LAST CORDNO EQ 2) THEN CORDNO -1 ELSE CORDNO; CORDLINNO/P3 = IF MPORVORDNO EQ LAST MPORVORDNO THEN CORDLINNO + 1 ELSE 1; LNCHECK/P5.3 = CORDLINNO/250; CORDLINNO1/P3 = IF LNCHECK LE 1 THEN CORDLINNO ELSE 1; CORDLINNO/P3 = IF CORDLINNO1 NE 1 THEN CORDLINNO ELSE 1; CORDNO1/P6 = CORDNO; CORDNO/P6 = IF CORDLINNO1 EQ 250 THEN CORDNO + 1 ELSE CORDNO; CSORDNO/A6 = EDIT(CORDNO1); CSORDLINNO/A3 = EDIT(CORDLINNO1); END
You define CORDNO in the first line, and redefine it three times in subsequent lines. Remove the formats (bolded) from the redefinitions.
quote:
TABLE FILE INFILE BY CSORDNO BY CSORDLINNO BY MPORVORDNO BY MPORVPRODNO BY MPORVITEMNO BY MPORVITEMNO ON TABLE HOLD AS OUTFILE END
You show 5 columns in the output. I don't buy it.
That TABLE is equivalent to TABLE FILE INFILE SUM CSORDNO NOPRINT BY CSORDNO BY CSORDLINNO BY MPORVORDNO BY MPORVPRODNO BY MPORVITEMNO BY MPORVITEMNO ON TABLE HOLD AS OUTFILE END The resulting Hold would have 7 fields if HOLDLIST=ALL, or 6 if HOLDLIST=PRINTONLY.
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
Even after those changes the output remains the same. I have worked out to a solution for this as per the below DEFINE FILE statement. The remaining stuff remains the same:
DEFINE FILE INFILE
-*CORDNO/P6 = 50099;
CORDNO/P6 = IF MPORVORDNO EQ LAST MPORVORDNO THEN CORDNO ELSE CORDNO + 1;
CORDNO/P6 = IF (CORDNO - LAST CORDNO EQ 2) THEN CORDNO -1 ELSE CORDNO;
CORDLINNO/P3 = IF MPORVORDNO EQ LAST MPORVORDNO THEN CORDLINNO + 1 ELSE 1;
LNCHECK/P5.3 = CORDLINNO/250;
CORDLINNO1/P3 = IF LNCHECK LE 1 THEN CORDLINNO ELSE 1;
CORDLINNO/P3 = IF CORDLINNO1 NE 1 THEN CORDLINNO ELSE 1;
CORDNO1/P6 = CORDNO + 50099;
CORDNO/P6 = IF CORDLINNO1 EQ 250 THEN CORDNO + 1 ELSE CORDNO;
CSORDNO/A6 = EDIT(CORDNO1);
CSORDLINNO/A3 = EDIT(CORDLINNO1);
END
After these changes the output on screen and in a hold file is as expected. Still I coundnt understand the strange behaviour. Was that because of CORDNO/P6 = 50099; statement?
-Shrikant
FOCUS 7.2.3 Platform: IBM system Z9 Business class O/P formats: Flat files, excel and CSV files
Posts: 39 | Location: Hyderabad, India | Registered: April 28, 2007
You aren't doing what Jack said. He said that if you are 'defining' a field more than once, take the format off of definitions 2 through n.
CORDNO/P6 = 50099;
CORDNO = IF MPORVORDNO EQ LAST MPORVORDNO THEN CORDNO ELSE CORDNO + 1;
CORDNO = IF (CORDNO - LAST CORDNO EQ 2) THEN CORDNO -1 ELSE CORDNO;
I have made the changes as suggested by Jack, but the result remains the same. Though I noticed commenting CORDNO/P6 = 50099; from the original code resolves the problem, the output displayed is same as what is in the file. Strange?
FOCUS 7.2.3 Platform: IBM system Z9 Business class O/P formats: Flat files, excel and CSV files
Posts: 39 | Location: Hyderabad, India | Registered: April 28, 2007