this is what I came up with, which works fine...is there a better method or is this ok?
-DEFAULT &EMP_ID='11318'
-DEFAULT &LAST_NAME='MMCDONALD'
-DEFAULT &FIRST_NAME='MATT'
-DEFAULT &DEPARTMENT='IS'
-DEFAULT &EMAIL='MMCDONALD@MEDLINE.COM'
-DEFAULT &SKILLS1='''V001'''
-DEFAULT &MEMBERSHIPS='WEBFOCUS'
-RUN
-SET &XFMT='A' | &SKILLS1.LENGTH;
-SET &VARA=STRREP(&SKILLS1.LENGTH,&SKILLS1.QUOTEDSTRING,&SKILLS1.LENGTH,''' OR ''',4,' OR ',&SKILLS1.LENGTH,'&XFMT');
-SET &VARRLEN = ARGLEN(&VARA.LENGTH,&VARA,'I5');
-SET &VARALEN = &VARRLEN - 2;
-SET &VARALEN1 = &VARRLEN - 1;
-SET &VARAFMT = 'A' || &VARALEN.EVAL;
-SET &VARB=SUBSTR(&VARA.LENGTH,&VARA,2,&VARALEN1,&VARALEN,'&VARAFMT');
-SET &VARC=STRREP(&VARB.LENGTH,&VARB.QUOTEDSTRING,2,'''',4,'''''',&VARB.LENGTH,'&XFMT');
-SET &ZXSDOC='''' || STRREP(&VARC.LENGTH,&VARC.QUOTEDSTRING,4,' OR ',5,''',''',&VARC.LENGTH,'&XFMT') || '''';
-SET &XDOC1=EDIT(&ZXSDOC,'$$$$$9999');
-SET &XDOC2=EDIT(&ZXSDOC,'$$$$$$$$$$$$9999');
-SET &XDOC3=EDIT(&ZXSDOC,'$$$$$$$$$$$$$$$$$$$9999');
-SET &XDOC4=EDIT(&ZXSDOC,'$$$$$$$$$$$$$$$$$$$$$$$$$$9999');
-SET &XDOC5=EDIT(&ZXSDOC,'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$9999');
-SET &XDOC6=EDIT(&ZXSDOC,'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$9999');
-SET &XDOC7=EDIT(&ZXSDOC,'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$9999');
-SET &XDOC8=EDIT(&ZXSDOC,'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$9999');
-SET &XDOC9=EDIT(&ZXSDOC,'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$9999');
-SET &XDOC10=EDIT(&ZXSDOC,'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$9999');
-SET &XDOC11=EDIT(&ZXSDOC,'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$9999');
-SET &XDOC12=EDIT(&ZXSDOC,'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$9999');
-SET &XDOC13=EDIT(&ZXSDOC,'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$9999');
-SET &XDOC14=EDIT(&ZXSDOC,'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$9999');
-SET &SKILLCODE='('
- | '''' || &XDOC1 || '''' | ','
- | '''' || &XDOC2 || '''' | ','
- | '''' || &XDOC3 || '''' | ','
- | '''' || &XDOC4 || '''' | ','
- | '''' || &XDOC5 || '''' | ','
- | '''' || &XDOC6 || '''' | ','
- | '''' || &XDOC7 || '''' | ','
- | '''' || &XDOC8 || '''' | ','
- | '''' || &XDOC9 || '''' | ','
- | '''' || &XDOC10 || '''' | ','
- | '''' || &XDOC11 || '''' | ','
- | '''' || &XDOC12 || '''' | ','
- | '''' || &XDOC13 || '''' | ','
- | '''' || &XDOC14 || ''''
- | ');' ;
-RUN
SET ASNAMES=ON
TABLE FILE MENTORSKILLS
SUM SKILLS1 NOPRINT
BY MENTYPE
BY SKILLS1
BY SKILL_DESC1
WHERE MENTYPE EQ 'MENTOR';
WHERE SKILLS1 IN &SKILLCODE
ON TABLE HOLD AS 'HOLDSKILLS'
END
-RUN
DEFINE FILE MEDLINEMENTOR
XMENTYPE/A10='MENTOR';
XEMP_ID/A9='&EMP_ID';
XFIRST_NAME/A15='&FIRST_NAME';
XLAST_NAME/A15='&LAST_NAME';
XDEPARTMENT/A10='&DEPARTMENT';
XEMAIL/A60='&EMAIL';
XMEMBERSHIPS/A40='&MEMBERSHIPS';
END
TABLE FILE MEDLINEMENTOR
SUM MENTYPE NOPRINT
XLAST_NAME AS 'LAST_NAME'
XFIRST_NAME AS 'FIRST_NAME'
XDEPARTMENT AS 'DEPARTMENT'
XEMAIL AS 'EMAIL'
XMEMBERSHIPS AS 'MEMBERSHIPS'
BY XMENTYPE AS 'MENTYPE'
BY XEMP_ID AS 'EMP_ID'
IF RECORDLIMIT EQ 1;
WHERE MENTYPE EQ 'MENTOR';
ON TABLE HOLD AS 'HOLDMENTOR'
END
-RUN
MATCH FILE HOLDSKILLS
PRINT
SKILLS1
SKILL_DESC1
BY MENTYPE
RUN
FILE HOLDMENTOR
SUM
EMP_ID
LAST_NAME
FIRST_NAME
DEPARTMENT
EMAIL
MEMBERSHIPS
BY MENTYPE
AFTER MATCH HOLD AS 'HOLDPROF' OLD-OR-NEW
END
-RUN
MODIFY FILE MEDLINEMENTOR
LOG DBMSERR MSG OFF
LOG DUPL MSG OFF
LOG INVALID MSG OFF
LOG NOMATCH MSG OFF
LOG FORMAT MSG OFF
LOG ACCEPT MSG OFF
LOG TRANS MSG OFF
FIXFORM FROM HOLDPROF
MATCH MENTYPE EMP_ID
ON NOMATCH INCLUDE
ON MATCH UPDATE LAST_NAME FIRST_NAME DEPARTMENT EMAIL
ON MATCH CONTINUE
MATCH SKILLS1
ON NOMATCH INCLUDE
ON MATCH UPDATE SKILL_DESC1
ON MATCH CONTINUE
MATCH MEMBERSHIPS
ON NOMATCH INCLUDE
ON MATCH REJECT
DATA ON HOLDPROF
END
-RUN
-TYPE " "
-TYPE " "
-TYPE " "
-TYPE " "
-TYPE " "
-TYPE " "
-TYPE " "
-TYPE " "
-TYPE
-TYPE " Update Submitted for - Employee ID: &EMP_ID"
-RUN
-EXIT
8.0.9, Windows
excel / pdf