AS400 Mid Range/PASSING ARIABLE FROM CLP TO ASP WEBPAGE

Advertisement


Question
QUESTION: Good Morning
I am trying to pass a variable with the help of STRPCCMD. can u help me. My command is
'Start hhtp:\\IP address\My webpage.asp?NSN=VARIABLE' *NO PAUSE
Its does not pass variable but when I write a value in place of variable its work fine. Pls answer me with example because I am New one. Thanks
Best Regards
Liaquat

ANSWER: I'm assuming that you are using a CL program to issue the STRPCCMD command.

1. Define a field 123 characters long to hold your command (anything longer will cause an error):

DCL &CMD *CHAR 123
DCL &VARIABLE *CHAR 25


Then place your command into that field:

CHGVAR &CMD VALUE("Start hhtp:\\IP address\My webpage.asp?NSN=" *CAT &VARIABLE *CAT " *NO PAUSE"

Then run the command:

STRPCCMD &CMD


If that doesn't work, check this website:

http://www-01.ibm.com/support/docview.wss?uid=nas125cbd3c71c3cafd0862572d700525c

OR try using RUNRMTCMD instead.


- Laird


---------- FOLLOW-UP ----------

QUESTION:  FMT **  ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7  
       *************** Beginning of data *************************************
0001.01          PGM        PARM(&PATNO)          
0007.02          DCL &CMD *CHAR 123          
0007.03          DCL VAR(&PATNO) TYPE(*CHAR) LEN(7)          
0007.04          
0008.02          CHGVAR     VAR(&CMD) VALUE('"START +          
0008.03          HTTP:\\192.168.5.99\NREPNSN.ASP?NSN="*CAT +   
0008.04          &PATNO CAT*"')          
0008.05          
0009.00          STRPCCMD &CMD          
0011.00    MONMSG     MSGID(CPF5192)          
0012.00  ENDPGM          
       ****************** End of data ****************************************

Hi Laird
I tried ur code but not work. I pasted my code above, I am getting a value patno from other programme and tried to pass that value to asp page. pls read my code and correct it where u like. Thanks  

Answer
At the end of line 0008.03 add a space before the final *CAT.

At the end of line 0008.04, change CAT* to *CAT

Also, you might add a line 0008.10 that reads:

SNDPGMMSG &CMD

Once your syntax is correct in your CHGVAR line, this will send you a message that shows you what the finished &CMD string looks like.

- Laird

AS400 Mid Range

All Answers


Answers by Expert:


Ask Experts

Volunteer


Concise Systems/Laird Scranton

Expertise

General AS/400, RPG/400, SDA and CL programming questions. AS/400 performance tuning.

Experience


Past/Present clients
CB Sportswear
Coca-Cola of New York
Encore Paper Company
Golub Corporation
HBO Home Video
Imperial Pools
Kaiser Permanente of NE New York
Mallinckrodt Medical
Marigold Foods
Manpower & Associates
National Datacomputers
New York State Easter Seals Society
New York State Food Merchants Association
Pepsi-Cola Allied Bottlers
Petricca Construction
Taconic Telephone Corporation
TOMRA Recycling
Unistress Corporation

©2012 About.com, a part of The New York Times Company. All rights reserved.