Example of how to explode the fone file that will read a fone_file and create a TR or ASCII file with one record for every attempt on that number

Attached is a spec FONEEXPLODE.SPX that will read a fone_file and create a TR file with one record for every attempt on that number.

It must easier to design reports for the one record per attempt file since you only have to look in a single location for data.

The record layout will match the fone file, except that history will be one phone record for every attempt. The Last history and first history fieldswill contain the same information about that one attempt.

Records with no attempts will get a single record with no history.

There will be two flags in columns 5997 and 5598.

5998 will be a 1 if this is indeed the last history of this number.

5997 will be a 1 if this is the last history in the given date range.

If you don’t set a date range than 5997 and 5998 will be the same.You can use 5998 to subset the run to guarantee that you only get onephone record per run.

Change the InputName to the name of your .Fon file

Change InputOpt to ASCII=16100 if you want to run on converted ASCII file

Change the OutName to the name of the file you want to output

Change OuptutOpt to ASCII if you want to output an ASCII file instead of TR

Change (and uncomment) DateRange if you only want information from aparticular set of dates.

You can set DateRange to only write the records out called on a certaindate. If DateRange is commented out, then all dates are written.

>Define @InputName Phone.Fon>Define @InputOpt  Fone_Format  ''ASCII=16100>Define @OutName   TestInt>Define @OutputOpt ASCII  ''Switch this to ASCII to write out an ASCII file''>Define @DateRange 20120701-20120731 ''YOU SHOULD NOT TOUCH CODE BELOW HERE, UNLESS YOU KNOW WHAT YOU ARE DOING>PurgeSame>FillDefinesInQuotes~In @InputName  @InputOpt    Length=16100,Dot=100,Numbuf=2,Study=Orig~In $,Length=6200,NewBuf,Study=Outpt~Out @OutName  Length=6200>Ifdef @OutputOpt@OutputOpt TrimBlanks>Endif~DefProc=WritHist:If FirstCaseChoosefile "Outpt"Next FirstChoosefile "Orig"EndifBlank Outpt![1-6200]Copy Outpt![1-5599] = [1.5599]While MaxTimes=100 [6100.100^NB]Copy Outpt![6000.100] = [6100.100]Copy Outpt![6100.100] = [6100.100]Copy [6100.9900] = [6200.9900]If [6100.100^B]Modify Outpt![5997] = 1Modify Outpt![5998] = 1''      Error "Last History"Endif''   Error "Cur Date " Outpt![6010.8$]''   Error "Next Date" [6110.8$]>IfDef @DateRangeIf Outpt![6010.8# @DateRange ]''      Error "Cur Date in @DateRange"If [6110.8# @DateRange ] ElseModify Outpt![5998] = 1''         Error "Next Date Not in @DateRange"EndifChoosefile "Outpt"WriteCaseChoosefile "Orig"Endif>Else''   Error "No DateRange"Choosefile "Outpt"WriteCaseChoosefile "Orig">EndifEndWhile }~Exc Proc=WritHist On Orig ~End

  • foneexplode.spx