Passing arguments to SOURCE via PANELS



IBM's Command List programming language & Restructured Extended Executor

Passing arguments to SOURCE via PANELS

Postby Ramsee » Tue Dec 10, 2013 3:54 pm

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
Ramsee
 
Posts: 25
Joined: Wed Nov 20, 2013 6:08 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Passing arguments to SOURCE via PANELS

Postby NicC » Tue Dec 10, 2013 4:06 pm

Do not include spaces in your arguments. You are using space to parse the argument string into its component parts.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Passing arguments to SOURCE via PANELS

Postby Ramsee » Tue Dec 10, 2013 4:10 pm

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
Ramsee
 
Posts: 25
Joined: Wed Nov 20, 2013 6:08 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Passing arguments to SOURCE via PANELS

Postby NicC » Tue Dec 10, 2013 4:23 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Passing arguments to SOURCE via PANELS

Postby enrico-sorichetti » Tue Dec 10, 2013 6:11 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Passing arguments to SOURCE via PANELS

Postby NicC » Tue Dec 10, 2013 7:02 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Passing arguments to SOURCE via PANELS

Postby Pedro » Tue Dec 10, 2013 10:28 pm

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
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post