View previous topic :: View next topic
|
Author |
Message |
Csongor
New User
Joined: 23 Apr 2015 Posts: 20 Location: Hungary
|
|
|
|
Hello,
I would like to give two parameters to a Program in REXX. These should be in different lines, because otherwise they will not be processed. But if I put them in two different lines they are processed separately. Is there any way to give two lines as parameter to a program? I know it depends on the program to, but I am curious, maybe someone know some kind of solution.
Code: |
ADDRESS TSO
DSN ='yyyyyyy'
"ALLOC F(AJMPRINT) DA(zzzzzzz) SHR"
"ALLOC F(AJMOUT) DA("DSN") SHR"
"AJMCMD ADDRESS AJM(xxxxx)"
"AJMCMD EXTRACT GROUP(xxxx) NET(xxxx)"
"FREE FILE(AJMPRINT)"
"FREE FILE(AJMOUT)"
"FREE FILE(AJMCMD)"
|
I need the two AJMCMD statements to be below each other, but processed at the same time.
I tried to allocate the ajmcmd and to open it with execio diskr, but the program did not do anything.
I tried the ADDRESS LINKpgm to, but I did not succeed. Any Idea? |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Why do they need to be "below each other"? Why can they not be on the same line? why can they not have other lines between?
Are you asking if multi-threading is possible in Rexx? (Nope, as far as I can tell - try PL/1). |
|
Back to top |
|
|
Csongor
New User
Joined: 23 Apr 2015 Posts: 20 Location: Hungary
|
|
|
|
Unfortunately the Program can process them only thisway, i tried it the give them in the same line.
I am not speaking about multi-threading, these belong together. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
unfortunately, while the problem might be clear to You, You were not able to explain it to us |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Two statements on one line is easy - just seperate each one with a semi-colon. But they still execute separately.
Or, do you mean you want the two statements to be merged into one statement?
I have no idea what AJMCMD is or AJM. It is not Rexx. Is it a vendor product? If so, the documentation should tell you how to use it and any problems should be addressed to the vendor. |
|
Back to top |
|
|
Csongor
New User
Joined: 23 Apr 2015 Posts: 20 Location: Hungary
|
|
|
|
Yes, it was the semicolon. I figured it out to in the meantime. But thank you anyway. Gosh, I spent too many hours on this little problem...
Yes AJM is not rexx, it is a vendor product. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
But why do you need the 2 statements on the same line? There is no difference between that and having them on separate lines. They both execute one at a time. Having them on separate lines is the preferred style. |
|
Back to top |
|
|
Csongor
New User
Joined: 23 Apr 2015 Posts: 20 Location: Hungary
|
|
|
|
I do not neccessariy need them in the same line, but if I put them just simply in two lines, they are processed after each other, separately, although they belong together.
I borrowed the whole thing from JCL(more parameters more lines), where this works fine, there was no very specific dokumentation for rexx, or tso.
This is why I asked. But the semi-colon works.
I wanted to know, if I can give parameters not only as string, but in an allocated dd, and open them with execio.
Or maybe with ATTCHPGM, of LINKPGM.
Or any other solution, that makes my code work. And then you saved the day. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
Quote: |
This is why I asked. But the semi-colon works. |
what is that You do not understand when we say that writing
Code: |
first rexx stmt; second rexx stmt;...;umpteenth rexx stmt |
the statements execute in STRICT sequence
and the behaviour is EXACTLY the SAME as writing
Code: |
first rexx stmt
second rexx stmt
...
umpteenth rexx stmt |
and NEVER a rexx script has the need to write multiple statements on the same line |
|
Back to top |
|
|
Csongor
New User
Joined: 23 Apr 2015 Posts: 20 Location: Hungary
|
|
|
|
I understand. I really appreciate that you make it clear.
Not like I want to prove you wrong, because I pretty sure you know much more than I in this topic. But I tried that:
"ALLOC F(AJMPRINT) DA(xx) SHR"
"ALLOC F(AJMOUT) DA("DSN") SHR"
"AJMCMD ADDRESS AJM(xx)"
"EXTRACT GROUP(xx) NET(xx)"
"FREE FILE(AJMPRINT)"
"FREE FILE(AJMOUT)"
"FREE FILE(AJMCMD)"
Trace: >L> "EXTRACT GROUP(xx) NET(xxx)"
IKJ56500I COMMAND EXTRACT NOT FOUND
Wich means the extract needs the AJMCMD, just like in the original code I posted. And thatway they are processed separately (because they are handled as separate rexx statement). In this case the program acts differently with a semicolon, and with statements in separate lines. Cheers[/code] |
|
Back to top |
|
|
Csongor
New User
Joined: 23 Apr 2015 Posts: 20 Location: Hungary
|
|
|
|
I understand. I really appreciate that you make it clear.
Not like I want to prove you wrong, because I pretty sure you know much more than I in this topic. But I tried that:
[code]
"ALLOC F(AJMPRINT) DA(xx) SHR"
"ALLOC F(AJMOUT) DA("DSN") SHR"
"AJMCMD ADDRESS AJM(xx)"
"EXTRACT GROUP(xx) NET(xx)"
"FREE FILE(AJMPRINT)"
"FREE FILE(AJMOUT)"
"FREE FILE(AJMCMD)"
[code]
Trace: >L> "EXTRACT GROUP(xx) NET(xxx)"
IKJ56500I COMMAND EXTRACT NOT FOUND
Wich means the extract needs the AJMCMD, just like in the original code I posted. And thatway they are processed separately (because they are handled as separate rexx statement). In this case the program acts differently with a semicolon, and with statements in separate lines. Cheers[/code] |
|
Back to top |
|
|
Csongor
New User
Joined: 23 Apr 2015 Posts: 20 Location: Hungary
|
|
|
|
And this the statement that works:
"AJMCMD ADDRESS AJM(xx);EXTRACT GROUP(xx) NET(xx)" |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
it means that the script is not parsed by rexx but by somebody else! |
|
Back to top |
|
|
Csongor
New User
Joined: 23 Apr 2015 Posts: 20 Location: Hungary
|
|
|
|
Yes, it the parameters are parsed by the program. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
as usual the info posted at the beginning was misleading ...
confusing a rexx statement with the parameters passed to AJMCMD
Code: |
"AJMCMD ADDRESS AJM(xx);EXTRACT GROUP(xx) NET(xx)" |
are NOT two rexx statements
just a strange way for the AJMCMD to parse the parameters.
topic moved, it is not a REXX problem. |
|
Back to top |
|
|
Csongor
New User
Joined: 23 Apr 2015 Posts: 20 Location: Hungary
|
|
|
|
I feel like I should apologise for asking....
Man, my first sentence was: "I would like to give two parameters to a Program in REXX"
And you say: confusing a rexx statement with the parameters passed to AJMCMD
Why exactly, I do not know. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
Quote: |
Why exactly, I do not know. |
because You asked in the REXX section of the forum
and You should have noticed that
we all replied according to the common practices and standards of REXX
if AJM wants parameters in a different format it means that
the question is not rexx related. AMEN |
|
Back to top |
|
|
|