Focal Point
Issue with defined field viewing on the Hold file

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3711024091

October 11, 2006, 06:22 PM
Viral
Issue with defined field viewing on the Hold file
Hi,

I have defined field. It prints all fine on the Table request command. If output is stored on the temp. hold file and then issue the Table request command on the temp. hold file. Define field prints upto certain records only.
Anybody faced similar problem or how can I fixed, pls. let me know.
Out of 236 rows Cutofftime shows upto 213 rows only.
For example of code
DEFINE FILE CAR
CUTOFFTIME = HADD(DATE1, 'DAY', -1, 8, 'HMDYY');
END

TABLE FILE CAR
PRINT
CUTOFFTIME
COUNTRY
ON TABLE HOLD AS TEMPHOLD1
END

TABLE FILE TEMPHOLD1
PRINT
CUTOFFTIME
COUNTRY
END

Thanks.


WF 7.6.2/ OS WIN2003.
DM 7.6.2
October 11, 2006, 06:28 PM
susannah
you seem to have forgotten to specify the format of your field CUTOFFTIME
I don't know your application, but you might try polishing up the code a bit.
The code you've shown doesn't run, as there is no field called DATE1 in the car file.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
October 11, 2006, 06:50 PM
Viral
Thanks for quick response.
Here is detail code in the defined field

DATE/A10= TODAY(DATE);
DATE1/HMDYY = HINPUT(14, DATE, 8, 'HMDYY');
CUTOFFDATE/HMDYY = HADD(DATE1, 'DAY', -1, 8, 'HMDYY');


WF 7.6.2/ OS WIN2003.
DM 7.6.2
October 11, 2006, 08:43 PM
susannah
you might want to make sure your DATE field is defined with some real, referenced field.
DATE/A10 WITH CAR = TODAY(DATE);
otherwise, when we define constants, (and this date thing is sort of a constant), we have to tell focus what segment of the data file to hook it to, so the WITH syntax does that for us.
Once we've hooked the DATE field to a segment, then all the other fields we define using it are assumed to exist in the same level.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
October 12, 2006, 03:45 AM
Tony A
Susannah,

Did you try using the WITH in Viral's example? If so what results did you get?

When I run in 7.1.3 without using the WITH I get all data fields populated. As soon as I put in the WITH I only get the date with the first record. This could be what Viral is experiencing, albeit in an ABT fashion!

Viral, I would urge you to get this reported to IB for them to investigate whether it is a "feature" or not. Use your code as an example in the case.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
October 12, 2006, 09:16 AM
susannah
dunno, T. don't know what his database is.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
October 12, 2006, 10:04 AM
Tony A
Hi Susannah,

I ran this against the sample DB CAR -
DEFINE FILE CAR
DATE/A10= TODAY(DATE);
DATE1/HMDYY = HINPUT(14, DATE, 8, 'HMDYY');
CUTOFFDATE/HMDYY = HADD(DATE1, 'DAY', -1, 8, 'HMDYY');
END

TABLE FILE CAR
PRINT
CUTOFFDATE
COUNTRY
ON TABLE HOLD AS TEMPHOLD1
END

TABLE FILE TEMPHOLD1
PRINT
CUTOFFDATE
COUNTRY
END
and got the full results that I would expect. However, we all know that (as you mentioned) a defined or computed field should be associated with a real field using the WITH fieldname syntax. When I add WITH COUNTRY to the DATE define I end up with just the CUTOFFDATE being populated for the first row of data Eeker which I don't think should happen.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
October 12, 2006, 01:43 PM
susannah
Yikes.
do this...
DEFINE FILE CAR 
DATE/A10    = TODAY(DATE);
DATE1/HMDYY = HINPUT(14, DATE, 8, 'HMDYY');
CUTOFFDATE/HMDYY = HADD(DATE1, 'DAY', -1, 8, 'HMDYY');
END
TABLE FILE CAR
PRINT   DATE DATE1 CUTOFFDATE COUNTRY  

and you get this:
DATE       DATE1      CUTOFFDATE COUNTRY 
10/12/2006 10/12/2006 10/11/2006 ENGLAND 
10/12/2006 10/12/2006 10/11/2006 JAPAN 
10/12/2006 10/12/2006 10/11/2006 ITALY 
10/12/2006 10/12/2006 10/11/2006 W GERMANY 
10/12/2006 10/12/2006 10/11/2006 FRANCE 


now...
do this:
DEFINE FILE CAR 
DATE/A10  WITH COUNTRY  = TODAY(DATE);
DATE1/HMDYY   = HINPUT(14, DATE, 8, 'HMDYY');
CUTOFFDATE/HMDYY  = HADD(DATE1, 'DAY', -1, 8, 'HMDYY');
END
TABLE FILE CAR
PRINT   DATE DATE1 CUTOFFDATE COUNTRY   

and you get this!

DATE       DATE1      CUTOFFDATE COUNTRY 
10/12/2006 10/12/2006 10/11/2006 ENGLAND 
10/12/2006                       JAPAN 
10/12/2006                       ITALY 
10/12/2006                       W GERMANY 
10/12/2006                       FRANCE 


moi, je suis confus
Viral,
just do this
YESTERDAY/I8YYMD = AYMD ( &YYMD , -1, 'I8YYMD');
taking the system date &YYMD

This message has been edited. Last edited by: susannah,




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
October 12, 2006, 02:26 PM
Francis Mariani
My tuppence:
-SET &RUN_DTTM  = &YYMD | EDIT(HHMMSS('A8'),'99$99$99') | '000';
DEFINE FILE CAR
DATE2/HYYMDS WITH MODEL = HINPUT(14, '&RUN_DTTM', 8, 'HYYMDS');
CUTOFFDATE1/HYYMDS WITH MODEL = HADD(DATE2, 'DAY', -1, 8, 'HYYMDS');
CUTOFFDATE2/HYYMD WITH MODEL = HADD(DATE2, 'DAY', -1, 8, 'HYYMD');
END
TABLE FILE CAR
PRINT
DATE2
CUTOFFDATE1
CUTOFFDATE2
END



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
October 12, 2006, 05:04 PM
Viral
Hi All,

Thanks for responding !!

I tried YESTERDAY/I8YYMD = AYMD ( &YYMD , -1, 'I8YYMD');
and also
CUTOFFDATE1/HMDYY WITH MODEL = HADD(DATE1, 'DAY', -1, 8, 'HMDYY');
Both works fine for me. Thanks for your suggestions.


WF 7.6.2/ OS WIN2003.
DM 7.6.2