Trimming og spaces in CLLE

145 pts.
Tags:
CL400.CL
CLLE
CPYTOIMPF
V5R4
Hi, i am using v5r4, CLLe I have creted this pgm to transfer stream file into ifs folder        PGM        Dcl Var(&Data) Type(*Char) Len(50)                    DCL VAR(&Folder) TYPE(*CHAR) LEN(30)             DCL VAR(&Filename) TYPE(*CHAR) LEN(100) /* Accessing the folder name from database to store the stream file INtest.CSV     */        CALL       PGM(MYS222B) PARM(' ' 'KEYF' &DATA ' ')        CHGVAR     VAR(&folder) VALUE(%SST(&DATA 1 30))        /* Create the name of stream file INtest.CSV     */                                                                          CHGVAR     VAR(&FILENAME) VALUE('/' *cat &Folder +                          *cat  'IN' *CAT +                                            'test.csv')                                                                                                                                      /* Copy the data                                           */                                                                                     CPYTOIMPF  FROMFILE(MyPF) TOSTMF(&FILENAME) +                                MBROPT(*add) STMFCODPAG(*PCASCII) +                                RCDDLM(*CRLF) FLDDLM(',') DATFMT(*EUR) +                           TIMFMT(*EUR)                                                                                                             EndPgm                  Value of &folder    = 'Myfolder/                                 ' Value of &Filename = '/Myfolder/                                  INtest.csv' the problem is that file name is taking extra spaces because length of variable &folder is 30 the data is only in 10 charecter. i can not fix the length of folder name because it can be changed.     i need the Value of &Filename = '/Myfolder/INtest.csv'                                is there any way to this (by trimming or anything else.. Thanks.

Software/Hardware used:
AS400

Answer Wiki

Thanks. We'll let you know when a new response is added.

Try this
CHGVAR VAR(&FILENAME) VALUE(‘/’ *Tcat &Folder *Tcat ‘IN’ *TCAT ‘test.csv’)

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Rpgle400tech
    thanks ! it works..!
    145 pointsBadges:
    report
  • CharlieBrowne
    Your welcome That is why we are here
    41,380 pointsBadges:
    report
  • Rpgle400tech
    [...] 9. CharlieBrowne provided the approved answer for a member wondering how to trim og spaces in CLLE. [...]
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following