Focal Point
[SOLVED] What .mas SUFFIX for this file?

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

April 25, 2012, 11:33 AM
RRKen
[SOLVED] What .mas SUFFIX for this file?
Does anyone recognize the data type for the data below and what SUFFIX might work to read it? This is the first 7 lines of the file (the data starts on line 6). I'm not having any luck with a master file to read it with the strange headers

company name,,,,,,,,,UDBCD123,(D830SAS1)
SUPPLY OPERATIONS, PERFORMANCE ANALYSIS,,,,,,,,, 24APR2012:01:41:39
COMBINED DATA UTILITY SERVICE SCORECARD
SELECT DATA- CUSTOMER SERVICE 01/01/2012 THROUGH 04/23/2012
FIELD ONE,FIELD TWO,FIELD THREE,LOCATION,TST SVC,MEAS,TIME FRAME,AVG VAR,GT -3,-3 : -2,-2 : -1,-1 : -.5,-.5 - 0,0 : .5,.5 : 1,1 : 2,2 : 3,GT 3
CC-,CC-SYSTEM, ,CC-SYSTEM,GOAL,NOTIFY,7-DAY,-0:09,0.6%,14.5%,34.9%,21.1%,11.4%,5.4%,1.8%,0.6%,2.4%,7.2%
CC-,CC-SYSTEM, ,CC-SYSTEM,GOAL,NOTIFY,M-T-D,0:32,0.7%,12.0%,38.7%,17.1%,11.4%,6.1%,1.8%,1.8%,1.2%,9.2%

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


8.2.03 AIX Client Windows Tomcat
DB2, Terradata, SQL, Oracle
April 25, 2012, 11:58 AM
Tony A
This should get the brain cells going of the elder more experienced members of the Forum Wink

If I remember correctly (JG jump in any time) you will need SUFFIX=FIX and also have FIELDNAME=RECTYPE.

Hopefully someone who remembers a little more will add to this to assist you in your quest.

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 
April 25, 2012, 12:59 PM
j.gross
Use FIX, with one fat alpha data field.
Define a line counter.

Use DEFINE to parse the significant data, as appropriate for your reporting needs, from the first 5 lines.

Extract lines 6 and beyond to a SAVE file. Construct a COMT synonym for that hold file, defining all the component fields as alpha; and use DEFINE to convert the measures (fields 8-18) into standard numeric data types:

- The eighth field ("AVG VAR") is either HH:MM or MM:SS, with optional leading minus sign: set up a define to convert that to minutes (or seconds) as a signed integer.
- Convert the last ten (the percents) into appropriate values (so 0.7% becomes .007).

Can you take it from there?
April 25, 2012, 02:05 PM
RRKen
quote:
last ten

Great, I don't need the first 5 but was hoping a specific type might ignore them. Counter is a good idea and will get me there.

Thanks!


8.2.03 AIX Client Windows Tomcat
DB2, Terradata, SQL, Oracle
April 26, 2012, 05:57 AM
<JG>
Tony is quite correct but I would combine RECTYPE with ACCEPT

ASSUMING that CC- is the rectype then

your basic master would be

 
FILENAME=funnyfile, SUFFIX=FIX     ,
   SEGMENT=REALDATA, SEGTYPE=S0,$
    FIELDNAME=RECTYPE,ALIAS= TheDATA, USAGE=A3, ACTUAL=A3, ACCEPT= CC-,$
    FIELDNAME=REALDATA, USAGE=A255, ACTUAL=A255, $ 

April 26, 2012, 03:11 PM
jgelona
Looks like a comma delimted file to me. I do this all the time with tab delimited data. I use a simple master and GETTOK. You should be able to do the same thing with comma delimited data.

Here's the master
FILE=TABDATA, SUFFIX=FIX, $
SEGNAME=SEG1 ,$
  FIELD=LDATA,,A240,A240, $

Here's the fex
 FILEDEF TABDATA DISK &APPROOT/baseapp/ippdata.txt ( LRECL 240 RECFM V
-*
 DEFINE FILE TABDATA
   TAB/A1=HEXBYT(9,'A1');
-*
   CHFN1/A25=GETTOK(LDATA,240,3,TAB,25,'A25');
   CHFN2/A25=GETTOK(LDATA,240,4,TAB,25,'A25');
   CHLN1/A25=GETTOK(LDATA,240,7,TAB,25,'A25');
   CHLN2/A25=GETTOK(LDATA,240,8,TAB,25,'A25');
   CHDOB/A10=GETTOK(LDATA,240,9,TAB,10,'A10');
   PRFN1/A25=GETTOK(LDATA,240,12,TAB,25,'A25');
   PRLN1/A25=GETTOK(LDATA,240,13,TAB,25,'A25');
 END
-*
 TABLE FILE TABDATA
 PRINT COMPUTE ROWID/I8=LAST ROWID+1;
       CHFN1 CHFN2 CHLN1 CHLN2 CHDOB PRFN1 PRLN1
 WHERE TOTAL ROWID GT 5
    ON TABLE HOLD
 END
-*
 DEFINE FILE TABDATA CLEAR
 END



In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.