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     [CLOSED] Mainframe FOCUS - strange behaviour

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Mainframe FOCUS - strange behaviour
 Login/Join
 
Silver Member
posted
Hi,

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.


-Shrikant

This 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, 2007Report This Post
Virtuoso
posted Hide Post
quote:
Any suggestions.

Yes, two:

That's obviously not the real code (lowercase formats don't fly).

Post your real code, and results, for "output to the screen".

Ditto for creating your HOLD file and reporting against it.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
The other thing here is what is the hold file used for ?

If the file is just being reread, and its OK, does it matter how it is stored.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Silver Member
posted Hide Post
Jack/Waz,


Below is the real code that I am using:


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):


 PAGE     1


 CSORDNO  CSORDLINNO  MPORVORDNO  MPORVPRODNO  MPORVITEMNO
 -------  ----------  ----------  -----------  -----------
 050100   001         MO000001    00001        1
          002         MO000001    00002        2
          003         MO000001    00003        3
          004         MO000001    00004        4
          005         MO000001    00005        5
          006         MO000001    00006        6
          007         MO000001    00007        7
          008         MO000001    00008        8
          009         MO000001    00009        9
          010         MO000001    00010        10
 050101   001         MO000002    00001        11
 050102   001         MO000003    00001        12
 050103   001         MO000004    00001        13
          002         MO000004    00002        14
          003         MO000004    00003        15
          004         MO000004    00004        16
          005         MO000004    00005        17
          006         MO000004    00006        18
          007         MO000004    00007        19
          008         MO000004    00008        20
          009         MO000004    00009        21
          010         MO000004    00010        22
 050104   001         MO000005    00001        23
          002         MO000005    00002        24
          003         MO000005    00003        25
          004         MO000005    00004        26
          005         MO000005    00005        27
          006         MO000005    00006        28
          007         MO000005    00007        29
          008         MO000005    00008        30
          009         MO000005    00009        31
          010         MO000005    00010        32
          011         MO000005    00011        33
          012         MO000005    00012        34
          013         MO000005    00013        35
          014         MO000005    00014        36




This is the output when the it is taken in a hold file, using ON TABLE HOLD AS OUTFILE and then displaying it using the following query:


TABLE FILE OUTFILE
PRINT *
END



Output:


 PAGE     1


 CSORDNO  CSORDLINNO  MPORVORDNO  MPORVPRODNO  MPORVITEMNO
 -------  ----------  ----------  -----------  -----------
 050099   001         MO000414    00251        3060       
 050099   001         MO000414    00252        3061       
 050099   001         MO000414    00253        3062       
 050099   001         MO000414    00254        3063       
 050099   001         MO000414    00255        3064       
 050099   001         MO000414    00256        3065       
 050099   001         MO000414    00257        3066       
 050099   001         MO000414    00258        3067       
 050099   001         MO000414    00259        3068       
 050099   001         MO000414    00260        3069       
 050099   001         MO000414    00261        3070       
 050099   001         MO000414    00262        3071       
 050099   001         MO000414    00263        3072       
 050099   001         MO000414    00264        3073       
 050099   001         MO000414    00265        3074       
 050099   001         MO000414    00266        3075       
 050099   001         MO000414    00267        3076       
 050099   001         MO000414    00268        3077       
 050099   001         MO000414    00269        3078       
 050099   001         MO000414    00270        3079       
 050099   001         MO000414    00271        3080       
 050099   001         MO000414    00272        3081       
 050099   001         MO000414    00273        3082       
 050099   001         MO000414    00274        3083       
 050099   001         MO000414    00275        3084       
 050099   001         MO000414    00276        3085       
 050099   001         MO000414    00277        3086       
 050099   001         MO000414    00278        3087       
 050099   001         MO000414    00279        3088       
 050099   001         MO000414    00280        3089       
 050099   001         MO000414    00281        3090       
 050099   001         MO000414    00282        3091       
 050099   001         MO000414    00283        3092       
 050099   001         MO000414    00284        3093       
 050099   001         MO000414    00285        3094       
 050099   001         MO000414    00286        3095       




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, 2007Report This Post
<JG>
posted
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.
 
Report This Post
Silver Member
posted Hide Post
No...its not, I have tried the same with other names too - OUTHLD, OUTHLD1, ORDHLD etc. None of these files are allocated previously.


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, 2007Report This Post
<SomeUsr>
posted
quote:
I am using mainframe FOCUS ...


Is this z/OS or z/VM mainframe FOCUS?
 
Report This Post
Expert
posted Hide Post
If INFILE is a flat file, the data has to be in the correct order for the LAST clause in the DEFINE statements to work.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Silver Member
posted Hide Post
INFILE is a hold file and is sorted in the following order:

MPORVORDNO
MPORVPRODNO
MPORVITEMNO


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, 2007Report This Post
Virtuoso
posted Hide Post
quote:

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, 2005Report This Post
Silver Member
posted Hide Post
Jack,

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, 2007Report This Post
Expert
posted Hide Post
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;


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Silver Member
posted Hide Post
Ginny,

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, 2007Report This Post
Expert
posted Hide Post
You state that the input file is sorted in this order:

MPORVORDNO
MPORVPRODNO
MPORVITEMNO

I think
BY CSORDNO
BY CSORDLINNO
BY MPORVORDNO
BY MPORVPRODNO
BY MPORVITEMNO
BY MPORVITEMNO

should be
BY MPORVORDNO
BY MPORVPRODNO
BY MPORVITEMNO
BY CSORDNO
BY CSORDLINNO


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report 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     [CLOSED] Mainframe FOCUS - strange behaviour

Copyright © 1996-2020 Information Builders