Focal Point
reading with GETTOK for blank fields there may be

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

May 27, 2008, 02:28 PM
serenekk
reading with GETTOK for blank fields there may be
Hi,
123456789,,,,,,,,

is a line from comma delimited file. I am trying to read this line and make it into each field. This is defined as FILLER with length of 112 in total to read this one whle line in my master.

-*GETTOK(infield, inlen, token_number, 'delim', outlen, outfield)
SSN/A09 = GETTOK(FILLER,112,1,',',09,'A09'); <-- IS THE FIRST FIELD.
CELL/A10 = GETTOK(FILLER,112,2,',',10,'A10');
this wont work..WHEN it is a blank field if the users dont fill this field out etc. How do code for this if the field I am trying to print into each field is blank?
Thanks so much in advance.


on VMS: OpenVMS AXP V8.2 Prod and TestEnvironment
Webfocus: WebFocus 7.6.1 Prod and TestEnvironment
May 28, 2008, 09:09 AM
PBrightwell
If you do just the SSN do you get the proper output? Is FILLER the only field in the master? Is it defined as A112 or A112V? Have you tried changing the 112 to FILLER.LEN or using ARGLEN to determine the actual length of the variable?

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


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
May 29, 2008, 08:34 PM
Jim Morrow
I have concatenated on to the end of a field "extra" tokens things always work properly.

WORK/A115 = FILLER || ', , , ';
SSN/A09 = GETTOK(WORK,115,1,',',09,'A09');
CELL/A10 = GETTOK(WORK,115,2,',',10,'A10');


Jim Morrow
Web Focus 7.6.10 under Windows 2003
MVS 7.3.3



May 30, 2008, 02:42 AM
Tony A
Using your post to build an example, and it works OK for me. What errors / symptoms are you receiving?

EX -LINES 4 EDAPUT MASTER,tempmast,CV,FILE
FILENAME=TEMPMAST, SUFFIX=FIX,$
SEGNAME=ONE, SEGTYPE=S1 ,$
  FIELD=FILLER  ,ALIAS=  ,A112 ,A112 ,$
-RUN

FILEDEF tempmast DISK tempmast.ftm
-RUN

-WRITE tempmast 123456789,,,,,,,,

-RUN
DEFINE FILE tempmast
  SSN/A09 = GETTOK(FILLER,112,1,',',09,'A09');
  CELL/A10 = GETTOK(FILLER,112,2,',',10,'A10');
END
TABLE FILE tempmast
PRINT *
      SSN
      CELL
END

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