Got it working! Had to switch from "CATX" to "CATS" to solve the quote issue. Also, the DOLLAR10. was not displaying the whole figure due to extra spaces generated from the "VVALUEX" function.....so I had to add a "COMPRESS". Below is the working code. Thank you @Tom @ballardw @Astounding for your input and help, a total team effort! DATA _NULL_; /* DLR HIS */
FILE DLRHIS DELIMITER = ',';
SET DHISF;
C = ',';
IF _N_ = 1 THEN PUT "&DHISNAMES"; /*COLUMN HEADER */
LENGTH RECD $3000.;
DO i = 1 TO COUNTW("&DHISV");
VRBL = SCAN("&DHISV", i);
IF INDEX(VNAMEX(VRBL), 'PAY') > 0 THEN DO;
RECD = CATS(RECD,QUOTE(PUT(
INPUT(COMPRESS(VVALUEX(VRBL)),DOLLAR10.),DOLLAR10.))||C);
END;
IF INDEX(VNAMEX(VRBL), 'PAY') = 0 THEN DO;
RECD = CATS(RECD, COMPRESS(VVALUEX(VRBL))||C);
END;
END;
PUT RECD;
... View more