QDFRTVFD — Retrieve Display File Description

From MidrangeWiki
Revision as of 04:21, 6 August 2014 by FKOL (talk | contribs) (initial setup)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

I based my DSM logic on this example http://www.code400.com/forum/showthread.php/11226-Dynamic-screen-example-with-FTP Dynamic screen example with FTP First off - Thanks to Scott Klement http://www.scottklement.com/ for posting the best samples of code on the web to play with! The code FTP's to a windows server (or what ever) and looks for .txt files. Those found it will display in the below window using the Dynamic screen API's: dyno.jpg

I based my code on QDFRTVFD API on the examplefrom Scott Klement. Thank you Scott. http://archive.midrange.com/rpg400-l/200603/msg00033.html

My code looks very different to Scotts work. But without Scotts example I would not have got anywhere.

The key to understanding the API is that on any one iteration though the data structures ONLY ONE FIELDS INFORMATION AT A TIME is retreived.

The program is not complete. But it does get enough info to show a layout. Much remains to be done a partial list is, WINDOWS, SUBFILES, REFERENCES, ATTRIBUTES etc etc etc. I am now amazed and humbled by the work of the IBM programmers that set up such a thing as a external display file.

I found IBM documention both detailed and frustrating in particular how to set the pointers to the next iteration of a DS. And there is a very devious bit on the indexes WDFWRRDX WDFWNMEI you must use these and never assume the fields follow some sequence.

I am having trouble with the retreival of attributes (file , record and field) I get a weird result with edit codes.

  1. FLDEDT = '�£ ��¥¥^:�¥¥^:�¥¥ ' for 1 61TIME EDTWRD('  :  : ')

EVAL #FldEdt  :x

  00000     03B14003 03B2B2B0 7A03B2B2 B07A03B2   - .£ ..¥¥^:.¥¥^:.¥   
  00010     B2404040 ........ ........ ........   - ¥   ............   

I found the IBM code for the API in QSYSINC too archane to use as is. However it was a good start and after removing the comments and renaming fields to match the IBM docs of QDFRTVFD I used the result. I also reformated some of the DS to use the OVERLAY notation. Also there are many fields missing in the QSYSINC of the type like WDFFRC

  ====  example of missing field  ===

Row-Column Table (QDFFRCTB) Row-column table, one table per screen size. Offset Bit Type Variable Name Dec Hex 0 0 CHAR(1) WDFFFRRO 1 1 CHAR(1) WDFFFRCO 2 2 CHAR(1) WDFFTORO 3 3 CHAR(1) WDFFTOCO 4 4 CHAR(1) WDFFRBIT 4 4 0 BIT(1) WDFFMDF 4 4 1 BIT(1) WDFFFRC1 4 4 2 BIT(1) WDFFTRAT 4 4 3 BIT(1) WDFFR1C1 4 4 4 BIT(1) WDFFR2C1 4 4 5 BIT(3) * 5 5 CHAR(1) * 6 6 CHAR(*) WDFFRC