As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at email@example.com and provide your corporate email address, company, and name.
For a single ORDNUM, there might be more than one ORDITEM values seperated by comma (,). I want to break the ORDITEM for a ORDNUM and make a another record with the ORDNUM. The expected output will be;
Assuming the items are in one text file, you could use the gettok and ljust functions to strip each one into a defined field. This will get the items into fields. Then look at the MacGuyer Technique of making one record into many.
A similation I use is to take an existing file and do something like this: (QUASI CODING HERE) DEFINE FILE AFILE BLANK/A1 = ' '; END TABLE FILE AFILE PRINT COMPUTE COUNTER/I2 = COUNT + COUNTER; BY BLANK ON TABLE HOLD AS FSEQ FORMAT FOCUS INDEX BLANK IF RECORDLIMIT EQ 12 (OR WHATEVER YOU NEED) DEFINE FILE BFILE PUT GETTOK STUFF HERE BLANK/A1 = ' '; END TABLE FILE BFILE PRINT ORDNUM ORDITM1 ORDITM2 ..... BY BLANK ON TABLE HOLD AS HOLD1 END JOIN BLANK IN HOLD1 TO ALL BLANK IN FSEQ AS J1 DEFINE FILE HOLD1 ORDITM/A(however long) = IF COUNTER EQ 1 THEN ORDITM1 ELSE IF COUNTER EQ 2 THEN ORDITM2 ELSE ...... ELSE ' '; END TABLE FILE HOLD1 PRINT ORDNUM ORDITM WHERE ORDITM NE ' ' END
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004