IC SunsetThe developerWorks Connections platform will be sunset on December 31, 2019. On January 1, 2020, this forum will no longer be available. More details available on our FAQ.
Topic
  • 6 replies
  • Latest Post - ‏2019-09-09T15:07:58Z by OSROMI
OSROMI
OSROMI
37 Posts

Pinned topic EASY EASY QUESTION REMOVE CHARACTER / A ONE A FIELD OR COLUMN

‏2019-09-06T20:15:08Z | caracter of string

I have a 33-position character string that contains two phones separated by keys // // I need to remove the plates to have the phones in a single field.

 

Sorry for my english

The character is /

 

98080808 // // 22353535
97090909 // 94959222
97080707  //      //      //   55353535

Updated on 2019-09-06T20:21:33Z at 2019-09-06T20:21:33Z by OSROMI
  • JonParis
    JonParis
    352 Posts
    ACCEPTED ANSWER

    Re: EASY EASY QUESTION REMOVE CHARACTER / A ONE A FIELD OR COLUMN

    ‏2019-09-06T20:27:53Z  

    If you just want to remove the // pairs and replace them with nothing then use %ScanRpl.

    Something like        %ScanRpl( '//': '' : sourceField );

     

    Or did you mean you want to use the // to identify the start of a new element and split the numbers into different fields?  In which case you just need %Scan and %Subst in a loop playing the phone number strings into array elements.

  • JonParis
    JonParis
    352 Posts
    ACCEPTED ANSWER

    Re: EASY EASY QUESTION REMOVE CHARACTER / A ONE A FIELD OR COLUMN

    ‏2019-09-06T23:04:42Z  
    • OSROMI
    • ‏2019-09-06T22:53:49Z

    This code does not work in the SEU the program must be FULL FREE not RPGLE Or it could be the Iseries version, I have V7R2M0

     

    The symbol is not valid; The symbol is ignored.

     WUDCP01 = %SCANRPL('//' : '' : WUDCP01); 

    Your problem is SEU not the RPG code. The fact that SEU doesn't like does not mean it is not valid.

     

    That code is perfectly valid at 7.2 - but SEU has not been updated since _V6_ AND NEVER WILL BE.

    Just ignore the SEU error message, Save the file anyway and enter N to "Return to edit" and it will compile perfectly.

     

    If your management won't pay for RDi - they are foolish not to but ... then try ILEditor (https://worksofbarry.com/ileditor/) which is free or miWorkplace (https://miworkplace.com/) which is very low cost. Don't get stuck back in the 1900s with SEU.

    Updated on 2019-09-06T23:07:26Z at 2019-09-06T23:07:26Z by JonParis
  • JonParis
    JonParis
    352 Posts
    ACCEPTED ANSWER

    Re: EASY EASY QUESTION REMOVE CHARACTER / A ONE A FIELD OR COLUMN

    ‏2019-09-06T23:06:41Z  
    • JonParis
    • ‏2019-09-06T23:04:42Z

    Your problem is SEU not the RPG code. The fact that SEU doesn't like does not mean it is not valid.

     

    That code is perfectly valid at 7.2 - but SEU has not been updated since _V6_ AND NEVER WILL BE.

    Just ignore the SEU error message, Save the file anyway and enter N to "Return to edit" and it will compile perfectly.

     

    If your management won't pay for RDi - they are foolish not to but ... then try ILEditor (https://worksofbarry.com/ileditor/) which is free or miWorkplace (https://miworkplace.com/) which is very low cost. Don't get stuck back in the 1900s with SEU.

    P.S. %ScanRpl was introduced in V7.1

  • JonParis
    JonParis
    352 Posts

    Re: EASY EASY QUESTION REMOVE CHARACTER / A ONE A FIELD OR COLUMN

    ‏2019-09-06T20:27:53Z  

    If you just want to remove the // pairs and replace them with nothing then use %ScanRpl.

    Something like        %ScanRpl( '//': '' : sourceField );

     

    Or did you mean you want to use the // to identify the start of a new element and split the numbers into different fields?  In which case you just need %Scan and %Subst in a loop playing the phone number strings into array elements.

  • OSROMI
    OSROMI
    37 Posts

    Re: EASY EASY QUESTION REMOVE CHARACTER / A ONE A FIELD OR COLUMN

    ‏2019-09-06T20:55:52Z  

    Is to replace the //
      thank you

  • OSROMI
    OSROMI
    37 Posts

    Re: EASY EASY QUESTION REMOVE CHARACTER / A ONE A FIELD OR COLUMN

    ‏2019-09-06T22:53:49Z  

    This code does not work in the SEU the program must be FULL FREE not RPGLE Or it could be the Iseries version, I have V7R2M0

     

    The symbol is not valid; The symbol is ignored.

     WUDCP01 = %SCANRPL('//' : '' : WUDCP01); 

    Updated on 2019-09-06T23:00:07Z at 2019-09-06T23:00:07Z by OSROMI
  • JonParis
    JonParis
    352 Posts

    Re: EASY EASY QUESTION REMOVE CHARACTER / A ONE A FIELD OR COLUMN

    ‏2019-09-06T23:04:42Z  
    • OSROMI
    • ‏2019-09-06T22:53:49Z

    This code does not work in the SEU the program must be FULL FREE not RPGLE Or it could be the Iseries version, I have V7R2M0

     

    The symbol is not valid; The symbol is ignored.

     WUDCP01 = %SCANRPL('//' : '' : WUDCP01); 

    Your problem is SEU not the RPG code. The fact that SEU doesn't like does not mean it is not valid.

     

    That code is perfectly valid at 7.2 - but SEU has not been updated since _V6_ AND NEVER WILL BE.

    Just ignore the SEU error message, Save the file anyway and enter N to "Return to edit" and it will compile perfectly.

     

    If your management won't pay for RDi - they are foolish not to but ... then try ILEditor (https://worksofbarry.com/ileditor/) which is free or miWorkplace (https://miworkplace.com/) which is very low cost. Don't get stuck back in the 1900s with SEU.

    Updated on 2019-09-06T23:07:26Z at 2019-09-06T23:07:26Z by JonParis
  • JonParis
    JonParis
    352 Posts

    Re: EASY EASY QUESTION REMOVE CHARACTER / A ONE A FIELD OR COLUMN

    ‏2019-09-06T23:06:41Z  
    • JonParis
    • ‏2019-09-06T23:04:42Z

    Your problem is SEU not the RPG code. The fact that SEU doesn't like does not mean it is not valid.

     

    That code is perfectly valid at 7.2 - but SEU has not been updated since _V6_ AND NEVER WILL BE.

    Just ignore the SEU error message, Save the file anyway and enter N to "Return to edit" and it will compile perfectly.

     

    If your management won't pay for RDi - they are foolish not to but ... then try ILEditor (https://worksofbarry.com/ileditor/) which is free or miWorkplace (https://miworkplace.com/) which is very low cost. Don't get stuck back in the 1900s with SEU.

    P.S. %ScanRpl was introduced in V7.1

  • OSROMI
    OSROMI
    37 Posts

    Re: EASY EASY QUESTION REMOVE CHARACTER / A ONE A FIELD OR COLUMN

    ‏2019-09-09T15:07:58Z  

    You are absolutely right, I thank you for the information, I will not work with SEU again.

    Thank you very much I will work with WebSphere is the one I have

    Updated on 2019-09-09T15:09:13Z at 2019-09-09T15:09:13Z by OSROMI