Debra Waybright Posted March 7, 2022 Posted March 7, 2022 I have a fex that does a SQL passthrough to get some data into a temp hold file and the code does a READFILE to put the fields into amper variables. Two of the fields are the same size I checked with a FF command against the hold file. I do an FPRINT against both fields with the same format (D12M) and it works for one, but the other results in all *. I checked the data that is being pulled by the SQL and both fields have the same number of digits. What is going on here heres the result of the FF: FILENAME= SQLYTD Weighted_Premium_YTD E01 P13 New_Premium_YTD E02 P13 heres the snippet of code: -READFILE SQLYTD -RUN -DEFAULTH &Weighted_Premium_YTD = ; -DEFAULTH &New_Premium_YTD = ; -DEFAULTH &Target_TPM_YTD= ; -DEFAULTH &Actual_TPM_YTD = ; -DEFAULTH &TPM_YTD_Diff = ; -SET &WEIGHTED_PREMIUM_YTD = FPRINT(&Weighted_Premium_YTD, D12M, WEIGHTED_PREMIUM_YTD); -SET &NEW_PREMIUM_YTD = FPRINT(&New_Premium_YTD, D12M, NEW_PREMIUM_YTD) ; heres the line of code where the amper variables are put on the report: FOOTING YTD <+0>&NEW_PREMIUM_YTD <+0>&WEIGHTED_PREMIUM_YTD Any ideas whats going on
Martin Yergeau Posted March 7, 2022 Posted March 7, 2022 Try with following instead. -SET &WEIGHTED_PREMIUM_YTD = FPRINT(&Weighted_Premium_YTD, 'P13', 'D12M'); -SET &NEW_PREMIUM_YTD = FPRINT(&New_Premium_YTD, 'P13', 'D12M'); You can use the way you code it in a DEFINE not in a -SET because the third element must define the output format and in a -SET, putting a field name does not have the format where in a DEFINE you have it such as below DEFINE WEIGHTED_PREMIUM_YTD /D12M = FPRINT(&Weighted_Premium_YTD, 'P13', WEIGHTED_PREMIUM_YTD); END
Walter Brengel Posted March 7, 2022 Posted March 7, 2022 This will work too: -SET &WEIGHTED_PREMIUM_YTD = FPRINT(&Weighted_Premium_YTD, D12M ); -SET &NEW_PREMIUM_YTD = FPRINT(&New_Premium_YTD, D12M) ; There is a new simplified version of FPRINT that does not need the third parameter. The issue I was having when I cut/paste the example was the apostrophes were open and closed apostrophes and not straight apostrophes, if that makes any sense. That may have just happened in my cut/paste though.
Debra Waybright Posted March 7, 2022 Author Posted March 7, 2022 @MartinY I tried that and got an error. @walter.brengel that fixed it! Thank you!
Jean-Claude Carriere 3 Posted March 8, 2022 Posted March 8, 2022 MartinY: -SET &WEIGHTED_PREMIUM_YTD = FPRINT(&Weighted_Premium_YTD, P13, D12M); I think FPRINT returns an ALPHA String, therefore if you are not using the simplified version (as suggested by Walter) the proper syntax should be something like -SET &WEIGHTED_PREMIUM_YTD = FPRINT(&Weighted_Premium_YTD, D12M, A12 );
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now