Focal Point
Dialogue Manager -Read command

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

January 23, 2008, 08:51 AM
philippe@Nantes
Dialogue Manager -Read command
Hi all,
I've just a problem with a -read command.
This command generate a HTTP 500 error.
Here's the code :
TABLE FILE &P_FICHIER
SUM &P_CHAMP NOPRINT
COMPUTE DOCID/A12='&P_DOCID';
COMPUTE DESC/A20='&P_DESCRIPTION';
-*COMPUTE NBE/I4 WITH &P_CHAMP=CNT.&P_CHAMP ;
&P_SELECTED
COMPUTE OPTION_VALUE/A256 = &P_CHAMP ;
COMPUTE OPTION_SELECT/A20 = SEL ;
COMPUTE OPTION_LIBELLE/A256 = &P_ZONE_LIB1 &P_CONCAT &P_ZONE_LIB2 &P_CONCAT &P_ZONE_LIB3 ;
BY &P_CHAMP NOPRINT
-*ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS OPT
END
-RUN
-SET &NBELEM=&LINES;
-SET &NUMELEM=0;
-MRNOEDIT EX JALLOUE HOLD=LISTBOXE,NIVEAU=W
-SET &TRIM = INT(RDUNIF('D12.10') * 1000000) + 1;
-SET &RANDOM = 'T1' || &TRIM;
-RUN
-DYNAM ALLOC FILE &RANDOM -
- DSNAME FO.EIDLSI.LSIPROV.&RANDOM -
- SPACE 10,10 TRACKS -
- RECFM VB LRECL 1076 -
- NEW CATLG
-RUN
-:LECTURE
-READ OPT NOCLOSE &Z_DOCID.A12. &Z_DESC.A20. &Z_VALUE.A256. &Z_SELECT.A20. &Z_LIBELLE.A256.

-IF &IORETURN NE 0 THEN GOTO :FIN_LECTURE;

I'm sorry but I don't see anything wrong.

Somebody can help me?

Thank's


WebFocus thru Dev Studio version 7.6.11
Dev Studio on Windows Xp, Webfocus Client on UNIX basing on TOMCAT and DB2,
Reporting Server on MVS , USS and on UNIX
January 23, 2008, 09:21 AM
GamP
Philippe,

First of all, please uncomment the -*ON TABLE SET HOLDLIST PRINTONLY statement.
Then there is one unknown item, &P_SELECTED. I can't tell what;s in there.
If you do the printonly, and the &&P_SELECTED is empty or otherwise harmless, then your -READ statement is (almost) correct.
Officially you should not include a format in your -READ statement, it should read:
-READ OPT NOCLOSE &Z_DOCID.12. &Z_DESC.20. &Z_VALUE.256. &Z_SELECT.20. &Z_LIBELLE.256.
Dialog Manager will decide fully automatically if it is a number or alpha variable.
The number after the variable is only to indicate dm how many characters to read for this var.
It may help to run the procedure with -SET &ECHO='ALL'; included, and withoyt the -READ (if that is indeed the problem). And then also check the holdfile to see if the contents is indeed exactly as you expect it to be.

Hope this helps...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
January 23, 2008, 09:23 AM
GamP
Tom,
HOLD FORMAT ALPHA in this case will be of no consequence, since all fields already are alpha.
The FILEDEF will take care of the correct reading of the file.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
January 23, 2008, 08:35 PM
Piipster
quote:
Officially you should not include a format in your -READ statement, it should read:
-READ OPT NOCLOSE &Z_DOCID.12. &Z_DESC.20. &Z_VALUE.256. &Z_SELECT.20. &Z_LIBELLE.256.
Dialog Manager will decide fully automatically if it is a number or alpha variable.
The number after the variable is only to indicate dm how many characters to read for this var.


I must disagree. The syntax used by Philippe is documented.

From a WebFOCUS Developing Applications language manual:
Syntax: How to Retrieve a Variable Value From an External File
-READ filename[,] [NOCLOSE] &name[.format.][,][&name][.format.]

&name[,]
Is the variable name. For free-format files, you may separate the variable names with
commas. If the list of variables is longer than one line, end the first line with a comma
and begin the next line with a dash followed by a blank. For fixed-format files, including
comma-delimited files, begin the next line with a dash, a blank, and a comma.
 
Free-format
-READ EXTFILE, &CITY, &CODE1,
- &CODE2
Fixed-format
-READ EXTFILE &CITY.A8. &CODE1.A3.,
- ,&CODE2.A3.
 


.format.
Is the format of the variable. For a free-format file, you do not have to specify this
value, but you may. For a fixed-format file, format is the length or the length and type of the variable (A is the default type). The value of format must be delimited by periods. The format is ignored for comma-delimited files.
Note: Instead of using .format., you can specify the length of a variable using -SET and enclosing the corresponding number of blanks in single quotes.
For example:
-SET &CITY=' ';
-SET &CODE1=' ';
-SET &CODE2=' ';


What most people forget is that the format can only be A or I. P, D, and F numeric formats are not allowed in DM variables.

From a mainframe language manual:
format
Is the format of the variable. It may be Alphanumeric (A) or Numeric (I).


ttfn, kp


Access to most releases from R52x, on multiple platforms.
January 24, 2008, 07:51 AM
philippe@Nantes
Thank's to all;

But I just found the answer some minutes later.
First, it's effectivly the read command which was in error.
Second, by using smaller format I bypass the problem.
No more than 80 CH per Amper variables !!!!!
Welcome back in the CARD READER format Wink
Is it a product limitation or a custom parameter ?


WebFocus thru Dev Studio version 7.6.11
Dev Studio on Windows Xp, Webfocus Client on UNIX basing on TOMCAT and DB2,
Reporting Server on MVS , USS and on UNIX
January 24, 2008, 12:49 PM
susannah
and i'll just mention that there *can* be a difference between HOLD FORMAT ALPHA and just HOLD even when all the fiels are alpha. The masters can be different, different field lengths having to do with half-word boundaries and such things it hurts my brain to have to resurrect...its just worthy of note, useful when tripping over.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
January 24, 2008, 02:42 PM
Tony A
One other point worth mentioning is that if you are not going to be using the held data in a TABLE request, then use ON TABLE SAVE, as you do not have the slight overhead of WF creating the .mas file that you won't be using anyway.

If you are in the habit of NOT naming your hold files, this could also save you some embarassment when you inadvertantly use this in lieu of some other hold file that was meant ot be present!

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