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] FILEDEF MASTER -WRITE ERROR FOC42256 and FOC209
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] FILEDEF MASTER -WRITE ERROR FOC42256 and FOC209
 Login/Join
 
Expert
posted
I'll show three scenarios which detail my issue. I think it's all due to the -WRITE command and the last character being a comma or a blank.
One thing that weird about this is that the TABLE FILE request runs fine after the fex completes that creates the synonym and run again is a new session. Yes, i have a -CLOSE tstmstr2 in there.
Please let me know your thoughts on solving this issue.

Scenarios 1 and 2 shows error with a COMMA as the last character in the -WRITE line and without the COMMA.
Scenario 3 shows positive results, no error, after a comma was added as the last character of the first -WRITE after the synonym was created and rechecked.

-* SCENARIO 1: THIS CODE
FILEDEF tstmstr2 DISK /{serverName}/app/ibi/apps/test_s3/tstmstr2.mas (LRECL 1024 RECFM V
-RUN
-WRITE tstmstr2 FILENAME=jsn, SUFFIX=JSON    ,
-WRITE tstmstr2  DATASET=/{serverName}/app/ibi/apps/jsn.json, $
-WRITE tstmstr2   SEGMENT=SEGMENT1, SEGTYPE=S0, $
-WRITE tstmstr2 FIELDNAME='FIELD1', USAGE='A32', ACTUAL=A128, TITLE='Field 1' ,MISSING=ON, REFERENCE=SEGMENT1, PROPERTY=ELEMENT,  $
-WRITE tstmstr2 FIELDNAME='FIELD2', USAGE='A32', ACTUAL=A128, TITLE='Field 2' ,MISSING=ON, REFERENCE=SEGMENT1, PROPERTY=ELEMENT,  $
-RUN
-CLOSE tstmstr2
-SET &ECHO = OFF ;
CHECK FILE tstmstr2 
TABLE FILE tstmstr2 PRINT *
END
?FF tst1
-EXIT

-* DISPLAYS THIS HTML:
 (FOC209) THE DATA VALUE EXCEEDS ITS LENGTH SPECIFICATION: JSON    WRITE tstmstr2
 ---------------------vvvvvvvvvvvvvvvvvvvvvv
 FILENAME=jsn, SUFFIX=JSON    WRITE tstmstr2  DATASET=/{serverName}/app/ibi/apps/jsn.json, $
 (FOC209) THE DATA VALUE EXCEEDS ITS LENGTH SPECIFICATION: JSON    WRITE tstmstr2
 BYPASSING TO END OF COMMAND
 (FOC209) THE DATA VALUE EXCEEDS ITS LENGTH SPECIFICATION: JSON    WRITE tst1
 ---------------------vvvvvvvvvvvvvvvvvv
 FILENAME=jsn, SUFFIX=JSON    WRITE tst1  DATASET=/{serverName}/app/ibi/apps/jsn.json, $

-* CREATES THIS SYNONYM:
FILENAME=jsn, SUFFIX=JSON    WRITE tstmstr2  DATASET=/{serverName}/app/ibi/apps/jsn.json, $
  SEGMENT=SEGMENT1, SEGTYPE=S0, $
FIELDNAME='FIELD1', USAGE='A32', ACTUAL=A128, TITLE='Field 1' ,MISSING=ON, REFERENCE=SEGMENT1, PROPERTY=ELEMENT,  $
FIELDNAME='FIELD2', USAGE='A32', ACTUAL=A128, TITLE='Field 2' ,MISSING=ON, REFERENCE=SEGMENT1, PROPERTY=ELEMENT,  $


-* SCENARIO 2: THIS CODE
 
FILEDEF tstmstr2 DISK /{serverName}/app/ibi/apps/test_s3/tstmstr2.mas (LRECL 1024 RECFM V
-RUN
-WRITE tstmstr2 FILENAME=jsn, SUFFIX=JSON    
-WRITE tstmstr2  DATASET=/{serverName}/app/ibi/apps/jsn.json, $
-WRITE tstmstr2   SEGMENT=SEGMENT1, SEGTYPE=S0, $
-WRITE tstmstr2 FIELDNAME='FIELD1', USAGE='A32', ACTUAL=A128, TITLE='Field 1' ,MISSING=ON, REFERENCE=SEGMENT1, PROPERTY=ELEMENT,  $
-WRITE tstmstr2 FIELDNAME='FIELD2', USAGE='A32', ACTUAL=A128, TITLE='Field 2' ,MISSING=ON, REFERENCE=SEGMENT1, PROPERTY=ELEMENT,  $
-RUN
-CLOSE tstmstr2
-SET &ECHO = OFF ;
CHECK FILE tstmstr2 
TABLE FILE tstmstr2 PRINT *
END
?FF tst1
-EXIT

-* DISPLAYS THIS HTML:
 0 NUMBER OF ERRORS=     0
 NUMBER OF SEGMENTS=   1  ( REAL=    1  VIRTUAL=   0 )
 NUMBER OF FIELDS=     2  INDEXES=   0  FILES=     1
 TOTAL LENGTH OF ALL FIELDS=  256
 (FOC42256) CONTENT NOT ALLOWED AT ROOT LEVEL. '<' EXPECTED
 0 NUMBER OF RECORDS IN TABLE=        0  LINES=      0
 (FOC209) THE DATA VALUE EXCEEDS ITS LENGTH SPECIFICATION: JSON    WRITE tst1
 ---------------------vvvvvvvvvvvvvvvvvv
 FILENAME=jsn, SUFFIX=JSON    WRITE tst1  DATASET=/{serverName}/app/ibi/apps/jsn.json, $

-* CREATES THIS SYNONYM:
FILENAME=jsn, SUFFIX=JSON
 DATASET=/{serverName}/app/ibi/apps/jsn.json, $
  SEGMENT=SEGMENT1, SEGTYPE=S0, $
FIELDNAME='FIELD1', USAGE='A32', ACTUAL=A128, TITLE='Field 1' ,MISSING=ON, REFERENCE=SEGMENT1, PROPERTY=ELEMENT,  $
FIELDNAME='FIELD2', USAGE='A32', ACTUAL=A128, TITLE='Field 2' ,MISSING=ON, REFERENCE=SEGMENT1, PROPERTY=ELEMENT,  $

-* SCENARIO 3: THIS CODE
-*MANUALLY ADDING A COMMA AFTER JSON, IN THE FIRST LINE, ELIMINATES THE FOC ERROR.
-*IGNORE THE ZERO RECORDS, I'LL DAEL WITH THAT LATER.

FILENAME=jsn, SUFFIX=JSON,
 DATASET=/{serverName}/app/ibi/apps/jsn.json, $
  SEGMENT=SEGMENT1, SEGTYPE=S0, $
FIELDNAME='FIELD1', USAGE='A32', ACTUAL=A128, TITLE='Field 1' ,MISSING=ON, REFERENCE=SEGMENT1, PROPERTY=ELEMENT,  $
FIELDNAME='FIELD2', USAGE='A32', ACTUAL=A128, TITLE='Field 2' ,MISSING=ON, REFERENCE=SEGMENT1, PROPERTY=ELEMENT,  $

-*AND DISPLAYS THIS HTML: Everything is fine with teh synonym creation.
 *** Done creating the Dynamic Synonym for tstmstr2 ...
 /{serverName}/app/ibi/apps/test_s3/tstmstr2.mas
 /{serverName}/app/ibi/apps/test_s3/tstmstr2.acx
 *** TABLE FILE tstmstr2 ...
 0 NUMBER OF RECORDS IN TABLE=        0  LINES=      0
 *** ?FF tstmstr2 ...
 FILENAME=  TSTMSTR2
 FIELD1                      A32
 FIELD2                      A32
 LIST                        I5
 *** CHECK FILE tstmstr2 PICTURE ...
 0 NUMBER OF ERRORS=     0
 NUMBER OF SEGMENTS=   1  ( REAL=    1  VIRTUAL=   0 )
 NUMBER OF FIELDS=     2  INDEXES=   0  FILES=     1
 TOTAL LENGTH OF ALL FIELDS=  256
 1SECTION 01
 STRUCTURE OF JSON     FILE TSTMSTR2 ON 02/20/20 AT 17.37.49
 SEGMENT1
 01      S0
 **************
 *FIELD1      **
 *FIELD2      **
 *            **
 *            **
 *            **
 ***************
 **************
 *** Started on Feb 20, 2020 at 17.37.49 ***


Thanks for making it to the end of this post. You get an extra AtaBoy (generically speaking)!

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




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Currently with Fidelity Investments
 
Posts: 3066 | Location: Middle Tennessee [8204M Gen48 in Test&Prod] | Registered: February 23, 2005Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Doug,
I'm not sure why you have REFERENCE=SEGMENT1.
References in the field definition points to a field which defines the highter level Element.
So, a field defined either as a PROPERTY=ELEMENT or PROPERTY=ATTRIBUTE will have a REFERENCE equal to a FIELD which defines the higher level ELEMENT.

For example:
{
"status": "success",
"data": {
"account": {

FIELDNAME=DUMROOT, ALIAS=JSON_DUMMY_EL, USAGE=A1, ACTUAL=A1, ACCESS_PROPERTY=(INTERNAL), $
FIELDNAME=STATUS, ALIAS=status, USAGE=A55, ACTUAL=A55,
MISSING=ON,
REFERENCE=DUMROOT, PROPERTY=ELEMENT, $
FIELDNAME=DATA, ALIAS=data, USAGE=A1, ACTUAL=A1,
MISSING=ON, ACCESS_PROPERTY=(INTERNAL),
REFERENCE=DUMROOT, PROPERTY=ELEMENT, $
FIELDNAME=ACCOUNT, ALIAS=account, USAGE=A1, ACTUAL=A1,
MISSING=ON, ACCESS_PROPERTY=(INTERNAL),
REFERENCE=DATA, PROPERTY=ELEMENT, $

I'm not sure why you have the REFERENCE equal to a SEGMENT definition.
 
Posts: 220 | Location: New York | Registered: July 27, 2004Reply With QuoteReport This Post
Platinum Member
posted Hide Post
I think the comma is a line continuation character for the -WRITE statement. You can

-SET &Comma = ','; 

Then use it like this:

-WRITE tstmstr2 FILENAME=jsn, SUFFIX=JSON  &Comma 


WF 8.2.06
Win10 / IE11
AHTML EXL2K PDF
 
Posts: 159 | Registered: October 19, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
dbeagan, Brilliant!!! And it works just fine. I think I tried putting a comma in a variable. But, sadly enough, I added the '.EVAL' which interpreted it as the continuation character instead of the desired comma as needed.

So, Thanks Again dbeagan Smiler




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Currently with Fidelity Investments
 
Posts: 3066 | Location: Middle Tennessee [8204M Gen48 in Test&Prod] | Registered: February 23, 2005Reply With QuoteReport This Post
Expert
posted Hide Post
Efrem,

BTW, I'm not sure why the REFERENCE=SEGMENT1 is there either (yet). But, it was automatically added during the synonym creation. This is an AWS S3 synonym.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Currently with Fidelity Investments
 
Posts: 3066 | Location: Middle Tennessee [8204M Gen48 in Test&Prod] | Registered: February 23, 2005Reply With QuoteReport This Post
Platinum Member
posted Hide Post
You are welcome. I'm glad the mystery is solved.


WF 8.2.06
Win10 / IE11
AHTML EXL2K PDF
 
Posts: 159 | Registered: October 19, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] FILEDEF MASTER -WRITE ERROR FOC42256 and FOC209

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