Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 07 JAN 1999 04:24:46PM Joseph K. Mueller wrote:

Hi –

I am working with arev version 2.0 and am trying to export a data file to an ascii text file. It seems that I am able to export data however for those fields that are designated as MULTIVALUED, I am only able to get 1 value per record and am not sure how to access the other values.

Through use of our application I have confirmed that multiple values exist but where they reside is a mystery to me.

Can anyone recommend how I can export the other field values that exist ??

Thanks in Advance for any help


At 07 JAN 1999 05:16PM Matt Sorrell wrote:

One solution would be to select the file by the multi-valued field. Selecting by a multi-valued field "explodes" that column repeating all non-MV information for each MV instance. Once you have the active select, you can then run your export ascii routine.

NOTE: Depending on the size of your MV fields, this can make for a VERY LARGE export file. Also, it is then incumbent on the programmer to normalize the flat file before importing that data elsewhere.

Matt Sorrell

msorrell@movgal.com


At 08 JAN 1999 12:42PM dsig@teleport.com wrote:

Joseph,

The easiest way to export data would be to use Pdisk and Rlist. Pdisk will route all printer output to a dos file AND Rlist will list all of your values as you want them.

This will create a fixed length formated file which can be imported into anything pretty easily.

dsig@teleport.com onmouseover=window.status=you have seen the rest .. now try the best!;return(true)"

David Tod Sigafoos ~ SigSolutions

voice: 503-639-8080


At 16 FEB 1999 03:10AM Dean Todd wrote:

I frequently export MVs to "lessor" filing systems.

If the field is SALES, (@Record) I create single value symbolics such as:

Sales_1 formula is @ANS= @RECORD

Sales_2 formula is @ANS= @RECORD etc.

. . . works every time.

Dean Todd - Computer Resource Team - Orlando

DeanTodd@compuserve.com


At 16 FEB 1999 10:35AM Victor Engel wrote:

I have created an export utility specifically designed for multivalued fields. Feel free to use and modify to suit your own needs. The program is called MVLIST and is designed to work like an RLIST statement, albeit much more simply. Compile and catalogue. Use at your own risk. The program was thrown together rather quickly. Calling syntax is:

MVLIST file_name field_list

field_list is a list of fields in the dictionary of file_name. This list may also include one or more of the keywords:

#KEY_CNT will increment for each Arev record

#KEY_CNT_DET will increment for each output line

#MV_CNT_UP will increment for each value associated with a given record

#MV_CNT_DOWN is like #MV_CNT_UP but the numbers are in reverse order.

KEYWORDS=#KEY_CNT.#KEY_CNT_DET.#MV_CNT_UP.#MV_CNT_DOWN'
SENTENCE=TRIM(@SENTENCE)
IF SENTENCE1,4=RUN ' THEN
   SENTENCE=FIELD(SENTENCE,' ',2,999)
END
FILENAME=FIELD(SENTENCE,' ',2)
OPEN FILENAME TO HANDLE ELSE
   CALL FSMSG()
   STOP
END
OPEN 'DICT',FILENAME TO @DICT ELSE
   CALL FSMSG()
   STOP
END
DICTLIST=FIELD(SENTENCE,' ',3,999)
CONVERT ' ' TO @FM IN DICTLIST
NUM_FIELDS=COUNT(DICTLIST,@FM) + (DICTLIST NE '')
DIM ANS(NUM_FIELDS)
ERR='
FOR FIELD_NO=1 TO NUM_FIELDS
   THIS_FIELD=DICTLIST
   READ DICTREC FROM @DICT, THIS_FIELD THEN
      TYPE=DICTREC
      IF TYPE=F' OR TYPE=S' ELSE
         CALL MSG('INVALID DICTIONARY|':THIS_FIELD)
         ERR=1
      END
   END ELSE
      IF THIS_FIELD1,1=#' ELSE
         CALL FSMSG()
         ERR=1
      END
   END
NEXT
CONVERSION=XLATE('DICT.':FILENAME,DICTLIST,7,'X')
SM        =XLATE('DICT.':FILENAME,DICTLIST,4,'X')
IF ERR THEN STOP
PROGRESS_FLAG=1
IF @REC.COUNT AND @LIST.ACTIVE ELSE
   SELECT HANDLE
   PROGRESS_FLAG='
END
OSFILENAME=C:\MVLIST.TXT'
CALL MSG('ENTER FILENAME','R',OSFILENAME)
OSWRITE '' ON OSFILENAME
OSOPEN OSFILENAME TO OSHANDLE THEN
   POSITION=0
   FINISHED='
   COUNTER=0
   DET_COUNTER=0
   CALL PROGRESS(0,'MVLIST',STATUS_LINE)
   OUTREC=DICTLIST
   CONVERT @FM TO \09\ IN OUTREC
   OUTREC := \0D0A\
   OSBWRITE OUTREC ON OSHANDLE AT POSITION
   POSITION += LEN(OUTREC)
   LOOP
      READNEXT @ID ELSE FINISHED=1
   UNTIL FINISHED
      COUNTER += 1
      READ @RECORD FROM HANDLE, @ID THEN
         NUM_VALS=1
         FOR A=1 TO NUM_FIELDS
            FIELD_NAME=DICTLIST
            LOCATE FIELD_NAME IN KEYWORDS USING '.' SETTING FIELD_POS ELSE
               TEMPANS=CALCULATE(FIELD_NAME)
               THISCONV=CONVERSION
               IF THISCONV THEN TEMPANS=TEMPANS THISCONV
               NUMVALS=COUNT(TEMPANS,@VM) + (TEMPANS NE '')
               IF NUMVALS GT NUM_VALS THEN TRANSFER NUMVALS TO NUM_VALS
               ANS(A)=TEMPANS
            END
         NEXT
         FOR VAL_NO=1 TO NUM_VALS
            DET_COUNTER += 1
            REV_VAL_NO=NUM_VALS + 1 - VAL_NO
            OUTREC='
            FOR FIELD_NO=1 TO NUM_FIELDS
               FIELD_NAME=DICTLIST
               IF FIELD_NAME1,1=#' THEN
                  BEGIN CASE
*KEYWORDS=#KEY_CNT.#KEY_CNT_DET.#MV_CNT_UP.#MV_CNT_DOWN'
                  CASE FIELD_NAME=#KEY_CNT'
                     ANSWER=COUNTER
                  CASE FIELD_NAME=#KEY_CNT_DET'
                     ANSWER=DET_COUNTER
                  CASE FIELD_NAME=#MV_CNT_UP'
                     ANSWER=VAL_NO
                  CASE FIELD_NAME=#MV_CNT_DOWN'
                     ANSWER=REV_VAL_NO
                  END CASE
               END ELSE
                  ANSWER=ANS(FIELD_NO)
               END
               IF OUTREC THEN
                  IF SM=M' THEN
                     OUTREC := \09\:ANSWER
                  END ELSE
                     OUTREC := \09\:ANSWER
                  END
               END ELSE
                  IF SM=M' THEN
                     OUTREC=ANSWER
                  END ELSE
                     OUTREC=ANSWER
                  END
               END
            NEXT
            OUTREC := \0D0A\
            OSBWRITE OUTREC ON OSHANDLE AT POSITION
            POSITION += LEN(OUTREC)
            IF PROGRESS_FLAG THEN
               CALL PROGRESS(1,COUNTER:@FM:@REC.COUNT,COUNTER)
            END ELSE
               CALL STATUP(2,3,POSITION "MD0,")
            END
         NEXT
      END
   REPEAT
   CALL PROGRESS(3,'',STATUS_LINE)
   OSCLOSE OSHANDLE
END ELSE
   CALL FSMSG()
   STOP
END

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/f4145947d2cdbc87852566f200759fef.txt
  • Last modified: 2024/01/04 21:00
  • by 127.0.0.1