Page 1 of 1

Passing arguments to SOURCE via PANELS

PostPosted: Tue Dec 10, 2013 3:54 pm
by Ramsee
Hi All,

Warm greetings!!

I am facing an error while passing Arguments from PANELS to SOURCE REXX CODE,that I need to pass three parameter from PANEL to SOURCE they are,

E-MAIL ID OF THE USER  ===>   abc@xyz.com                                               
                                                                             
COMPANY NAME             ===>   test test                                               
                                                                             
COMPANY NUMBER         ===>    123456                                             

CALL PGM:
CALL PGMNAME PNEMAIL PNCONAME PNCOMNUM

Argument in REXX SOURCE CODE
ARG mail_id company_name companynumber


Output in SCREEN using SAY command i printed the 3 ARG's:
mail_id :abc@xyz.com
company_name  : test
companynumber : test


ISSUE: here the COMPANY NUMBER is holding the value TEST (Because there was a space in between the COMPANYNAME variable, it is splitting the arguments into 'n' numbers due to 'n' number of spaces.

Validation in PANEL code:
VER(&PNEMAIL,NB) 
VER(&PNCONAME,NB)
VER(&PNCOMNUM,NUM)


Please suggest me how to resolve this issue.

Thanks,
Ramsee

Re: Passing arguments to SOURCE via PANELS

PostPosted: Tue Dec 10, 2013 4:06 pm
by NicC
Do not include spaces in your arguments. You are using space to parse the argument string into its component parts.

Re: Passing arguments to SOURCE via PANELS

PostPosted: Tue Dec 10, 2013 4:10 pm
by Ramsee
Hi NicC,

Yes you are correct, i used SPACE in the COMPANYNAME , but SPACE " " is also a valid value in the input that i enter, i need to pass " " (SPACES) to the program.

Could you please help me how to pass the SPACES into the correct parameter value.

Thanks a ton for the help and time.

Regrads,
Ramsee

Re: Passing arguments to SOURCE via PANELS

PostPosted: Tue Dec 10, 2013 4:23 pm
by NicC
ARG is really a variation on PARSE. Your program receives ONE argument - how you code your ARG defines how you interpret that one argument. If you have spaces in your data then try separating the fields by commas and parse by those.

Re: Passing arguments to SOURCE via PANELS

PostPosted: Tue Dec 10, 2013 6:11 pm
by enrico-sorichetti
no need to parse anything

after a DISPLAY PANEL

ISPF will create the appropriate REXX variables corresponding/with the same name
of the panel fields

Re: Passing arguments to SOURCE via PANELS

PostPosted: Tue Dec 10, 2013 7:02 pm
by NicC
Depends on the process: my understanding was that another rexx program was being called after getting the values from the panel. Even if this were the case there would be no need to pass arguments - just VPUT the variables in the first program and VGET them in the next.

Re: Passing arguments to SOURCE via PANELS

PostPosted: Tue Dec 10, 2013 10:28 pm
by Pedro
The default is for parse to separate at blanks. Since a blank is valid character in your fields, you need to use a different character.

Introduce a special character when you call the rexx program.
CALL PGMNAME PNEMAIL '06'x  PNCONAME '06'x PNCOMNUM

Within the rexx program, parse for the special character.
parse arg  mail_id  '06'x company_name  '06'x companynumber