Focal Point
[CLOSED]Senior Moment - Need to create filler records

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

May 24, 2011, 06:35 PM
S.J. Kadish
[CLOSED]Senior Moment - Need to create filler records
We are trying to create blank values for an excel that will be saved in a template. We limit the users to ten product attributes. The issue is creating blanks for the excel if the users decides to go with fewer than ten product attributes. (The template is an update from an existing version so these attributes cannot be appended to the end of the excel and copied over using VBA.)


[CODE -* &attribute_cnt is determined in the first read against the attribute tables
-SET &REMAINDER = 10 - &ATTRIBUTE_CNT;
TABLE FILE HOLDATTRIBS0
PRINT ATTRIBUTE_DESCFIELD_ABBR ATTRIBUTE_DESCFIELD_ABBR_MIN
ATTRIBUTE_LINE BY ATTRIBUTE_ID WHERE ATTRIBUTE_ID LT 100
-* This hold file only allows valid attributes - nowhere near 100 Smiler
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS HOLDATTRIBS1 END
-* the code below attempts to create enough slots to fill out to 10 columns in the excel
-* Unfortunately the number of records is not incrementing
-SET COUNTER = 0;
-REPEAT B_LOOPER2 &REMAINDER TIMES
-SET &COUNTER = &COUNTER + 1;
-SET &RECYCLE = &COUNTER;
-SET &THIS_DATE_0 = &YYMD + 1;
-SET &THIS_DATE = EDIT(&THIS_DATE_0,'9999/99/99');
DEFINE FILE HOLDATTRIBS1
NEW_DATE/A10 = '&THIS_DATE'; NEW_ATTRIBUTE_ID/I11 WITH ATTRIBUTE_ID = &RECYCLE + 100;

NEW_ATTRIBUTE_DESCFIELD_ABBR/A30 WITH ATTRIBUTE_ID = NEW_DATE | ' UPDATED' ;
NEW_ATTRIBUTE_DESCFIELD_ABBR_MIN/A34 WITH ATTRIBUTE_ID = 'MIN.' | NEW_ATTRIBUTE_DESCFIELD_ABBR;

NEW_ATTRIBUTE_NAME_ABBR/A30 WITH ATTRIBUTE_ID = 'The date';

NEW_ATTRIBUTE_LINE/A66 = NEW_ATTRIBUTE_DESCFIELD_ABBR | ' AS ' | '''' | NEW_ATTRIBUTE_NAME_ABBR | '''';
END

TABLE FILE HOLDATTRIBS1 PRINT DST.NEW_ATTRIBUTE_DESCFIELD_ABBR AS ATTRIBUTE_DESCFIELD_ABBR OVER DST.NEW_ATTRIBUTE_DESCFIELD_ABBR_MIN AS ATTRIBUTE_DESCFIELD_ABBR_MIN OVER DST.NEW_ATTRIBUTE_LINE AS ATTRIBUTE_LINE OVER DST.NEW_ATTRIBUTE_ID BY ATTRIBUTE_ID ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS HOLDATTRIBS2
END
-B_LOOPER2 -RUN CODE]

Clearly there is missing. Any thoughts are heartily encouraged.

Focus Nation Rocks!

This message has been edited. Last edited by: S.J. Kadish,


Sandy Kadish
Dev: 8.2.04- PostgreSQL
Test: 8.2.04 - PostgreSQL
Prod: 8.2.04 - PostgreSQL
May 24, 2011, 10:41 PM
Jim Morrow
It looks like each loop of the repeat is using the same hold. "ON TABLE HOLD AS HOLDATTRIBS2"

I would be inclined to set up a ten loop mcguver with some being the attributes and the rest empty.


Jim Morrow
Web Focus 7.6.10 under Windows 2003
MVS 7.3.3



May 26, 2011, 06:23 PM
S.J. Kadish
We did go with the McGuyver technique, using the fseq.mas, which is a great solution but had to dig to find it. It works wonderfully.

Thanks, Jim


Sandy Kadish
Dev: 8.2.04- PostgreSQL
Test: 8.2.04 - PostgreSQL
Prod: 8.2.04 - PostgreSQL