Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Getting multiple fields using -READFILE not working
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Getting multiple fields using -READFILE not working
 Login/Join
 
Platinum Member
posted
I feel certain this worked before, but it isn't now (Note, the table only holds one row):

TABLE FILE MAINT_REPORTING_DATES
PRINT BEGINNING_OF_YEAR
CURR_REPORTING_MTH_BEGINNING
BY CURR_REPORTING_MTH_END
ON TABLE HOLD AS HOLD_DATES
END
-RUN
-READFILE HOLD_DATES
-DEFAULTH &ME_DATE = '';
-DEFAULTH &CURR_REPORTING_MTH_END = '';
-DEFAULTH &BEGINNING_OF_YEAR = '';
-DEFAULTH &CURR_REPORTING_MTH_BEGINNING= '';
-SET &ME_DATE = EDIT(&CURR_REPORTING_MTH_END,'99/99/9999');
-SET &MB_DATE = EDIT(&CURR_REPORTING_MTH_BEGINNING,'99/99/9999');
-SET &YB_DATE = EDIT(&BEGINNING_OF_YEAR,'99/99/9999');
-SET &HMONTH = FPRINT(&ME_DATE,'Mtr','A9');

In fact, when I run this, I get a "hard kill" error. What is amiss?

Thanks in advance for your help!

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


WebFOCUS 8.2.03
AppStudio, InfoAssist
Windows, All Outputs
 
Posts: 127 | Location: Indiana | Registered: December 05, 2017Reply With QuoteReport This Post
Virtuoso
posted Hide Post
What's the format of the fields you're holding? Could you first show us what the &variables contain with a -TYPE before you edit them in the -SETs? Let's make sure your data looks right first.

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


WebFOCUS 8206, Unix, Windows
 
Posts: 1659 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Gold member
posted Hide Post
Hi,
I am not sure why do you need FPRINT, but that is causing the issue.
Remove the last line of your code and it should work.
as BabakNYC said print your values with Type to see if you are able to read them properly or not and then use functions.


WF 8.2.04
Windows/Unix
All Formats
In Focus since 2006
 
Posts: 74 | Location: UK | Registered: September 17, 2018Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Addy, you're a genius! I removed only the FPRINT statement and it worked. Is there a better way to get the month name and year into an amper variable?
THANKS!


WebFOCUS 8.2.03
AppStudio, InfoAssist
Windows, All Outputs
 
Posts: 127 | Location: Indiana | Registered: December 05, 2017Reply With QuoteReport This Post
Virtuoso
posted Hide Post
If you do the Month name translation in a Define before you hold the data, you'll get a text in the hold file that'll require no Dialogue Manager editing.

  
DEFINE FILE retail_samples/wf_retail
 Month/Mtr=WF_RETAIL.WF_RETAIL_TIME_SALES.TIME_DATE_DAY_COMPONENT ;
 YearMonth/YYM=WF_RETAIL.WF_RETAIL_TIME_SALES.TIME_DATE_DAY_COMPONENT ;
END

TABLE FILE retail_samples/wf_retail
BY Month
BY YearMonth
ON TABLE HOLD
END
-RUN
-DEFAULTH &Month='';
-DEFAULTH &YearMonth='';
-READFILE HOLD
-TYPE &Month &YearMonth 


WebFOCUS 8206, Unix, Windows
 
Posts: 1659 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Guru
posted Hide Post
You could also try the function CHGDAT
  
-SET &ME_DATE = &DATEMDYY;
-TYPE &ME_DATE
-SET &HMONTH = CHGDAT('MDYY', 'MX', &ME_DATE, 'A20V');
-TYPE &HMONTH


Hallway
WF(Prod):8202M
WF(Test):8202M
OS/Platform:Win 10
Outputs:All
 
Posts: 431 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Thanks for all the help!


WebFOCUS 8.2.03
AppStudio, InfoAssist
Windows, All Outputs
 
Posts: 127 | Location: Indiana | Registered: December 05, 2017Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Getting multiple fields using -READFILE not working

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.