Rocket U2 | UniVerse & UniData

 View Only
  • 1.  Command for setting a maximum characters

    Posted 12-22-2020 19:22

    Hello there,

    I need your expert advise please.

    I am using Universe 11.2.5.

    I have a report with 83 columns.

    For each transaction, some of the columns might have a data more than 1000 characters.

    I try to limit to a maximum of 1000 characters per column .

    I use the following command:

         FOR X = 1 TO 83

                 IF LEN(COL<X>)  >  1000  THEN 

                        PRT.RECORD :=  "," : COL<X>[1,1000]

    This LEN command did not work.

    in the PRT.RECORD, the content from COL<X>[1,1000] was more than 1000 characters.

    I also tried the LEFT command.

         PRT.RECORD := "," : LEFT(COL<X>,1000)

    This LEFT command did not work as well.

    in the PRT.RECORD, the content from LEFT(COL<X>,1000) was more than 1000 characters.

    Is there any other command to be used for setting a maximum character.

    Your advise would be most appreciated.

    Cheers



    ------------------------------
    Yossy Tan
    Analyst / Programmer
    Toyota Tsusho South Pacific Holdinh
    ------------------------------


  • 2.  RE: Command for setting a maximum characters

    PARTNER
    Posted 12-23-2020 08:29

    Hi,

    Sorry, I don't use Universe (I mainly use Unidata) but what you are saying looks correct.

    Have you tried putting COL<X> into a temporary variable and using that?

    e.g.

    FOR X = 1 TO 83

      TMP = COL<X>

      IF LEN(TMP) > "1000" THEN

        PRT.RECORD := "," : TMP[1,1000]

    Ideally would need to see more of the code or what is in COL to help better



    ------------------------------
    Mike Young
    Senior PS Techical Consultant
    Aptean - Sanderson
    ------------------------------



  • 3.  RE: Command for setting a maximum characters

    Posted 12-23-2020 18:47

    Thanks Manu and Mike for your response.

     

    I found out I used an incorrect way to count the number of characters.

     

    I use the Excel to check the number of character by putting the number 12345678901234567890 above the row that contains the data.

    I assumed the position of each character of the data should be the same as the number position in the row above.

     

    Apparently my assumption was wrong.

    By comparing the position between the row with the number and the row with the data, in one of the column, the last character was in the position of 1014.

     

    When I did count each characters manually, it turn up as 948 characters.

     

    I have to say, please disregard this posting.

     

    My apology for posting the wrong information.

     

     

    Cheers

     

    Yossy Tan
    Analyst/Programmer Information Technology 

    Toyota Tsusho South Pacific Holdings Pty Ltd
    P.O. Box 5559, West End, QLD 4101
    Level 3, 22 Cordelia Street, South Brisbane
    Queensland 4101, Australia
     

    Direct: +617 3512 9739 | Fax: +617 3367 1936 | Reception: +617 3512 9797
    E:
    YTan@toyota.tsusho.com.au | Web: www.toyota.tsusho.com.au

    The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.

    This email has been scanned for viruses and malware, and may have been automatically archived by Mimecast Ltd.
                                                                                                                                                                                                                                                                                                                   

    The information transmitted by this email is intended only for the person or entity to which it is addressed. This email may contain proprietary, business-confidential and/or privileged material. If you are not the intended recipient of this message, be aware that any use, review, retransmission, distribution, reproduction or any action taken in reliance upon this message is strictly prohibited. If you received this in error, please contact the sender and delete the material from all computers.






  • 4.  RE: Command for setting a maximum characters

    PARTNER
    Posted 12-23-2020 08:34

    hi,

    Are you working with NLS acrtive and your data are multi-byte characters ?

    What returns LEN(COL<X>) and LENDP(COL<X>) ? 



    ------------------------------
    Manu Fernandes
    ------------------------------