View previous topic :: View next topic
|
Author |
Message |
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
I am creating a dynamic JCL through a Rexx program.
In one of SYSIN Steps of the dynamic JCL i need to pass few values in lower case letters.
i gave it as below.
Code: |
SELECT
WHEN region = 'TEST' THEN DO
[b]regn [/b]= 't'
END
END |
Code: |
upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
lower = 'abcdefghijklmnopqrstuvwxyz'
[b]regn1[/b] = translate([b]regn[/b], lower, upper)
QUEUE '//JVEDTSAR EXEC '||procver||'
QUEUE '// SUBMINP='''||in_dsn||'('||membr||')'',
QUEUE '//S120.SYSIN DD DSN='||cclib||'(CP95115C),DISP=SHR
QUEUE '//S130.STDENV *
QUEUE 'Region='||[b]regn1[/b]||' |
but when JCL got created it is displaying value of regn1 field in 'T', instead of 't'
let me know how i print in lowe case
Appreciate your support
Code'd |
|
Back to top |
|
|
Smita.t2
New User
Joined: 17 Apr 2012 Posts: 31 Location: Bangalore
|
|
|
|
Try ISPF edit macro Caps off.
Code: |
ADDRESS ISREDIT "CAPS OFF" |
|
|
Back to top |
|
|
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
Thank s for the tip. but it didn't work,
Acutally i am creating a jcl and writing to a PS file which is being allocated by Rexx.
This is how i am allocating the file (OUTFILE)
Code: |
IF sysreason = 0 THEN DO
"DELETE '"schd_dsn"'"
END
"ALLOC FI(OUTFILE) NEW SP(1 1) TR DSORG(PS) RECFM(F B)
LRECL(80) DSN('"schd_dsn"')" |
i am wring the dynamic JCl to file (OUTFILE) as below
Code: |
maxbuf = QUEUED()
DO indx = 1 TO maxbuf BY 1
PULL record
IF record > '' THEN
QUEUE record /* only want records
END
QUEUE ''
"EXECIO * DISKW OUTFILE" |
is it possible to set CAPS OFF when the OUTFILE file is being created |
|
Back to top |
|
|
Smita.t2
New User
Joined: 17 Apr 2012 Posts: 31 Location: Bangalore
|
|
|
|
After dataset allocation, code something like this
Code: |
ADDRESS ISPEXEC 'EDIT DATASET('DSNNAME') MACRO(CAPS OFF)' |
|
|
Back to top |
|
|
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
i gave as below after allocating to dsnname
schd_dsn = user||'.T.CSP.Q.'||membr
ADDRESS ISPEXEC 'EDIT DATASET('"schd_dsn"') MACRO(CAPS OFF)' after created
but when i open the JCL inside schd_dsn, it is still shown REGION=T, which needs to be shown as REGION=t
//S130.STDENV *
REGION=T |
|
Back to top |
|
|
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
Also when i open the dataset in view mode and give PROF it says CAPS ON.
CAPS OFF yet to activate |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Why, if you have set the value to a lower-case "t", do you attempt to translate it from uppercase?
Are you aware of what PULL is equivalent to in terms of PARSE?
Do you know how to use Trace?
The code you've shown won't give you REGION= once you've corrected it for the "t". |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Sumeendar
Please use the code tags when posting code and data. You want help so make it as easy as possible for others to help. By using the code tags we can read your code better. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Bill gave you this hint:
Quote: |
Are you aware of what PULL is equivalent to in terms of PARSE? |
You should have read the Rexx Reference manual by now. If you have not yet read the section about PULL already, please do so now. |
|
Back to top |
|
|
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
I will sum up my orignrial requirement
The JCL i am preparing thru Rexx requires few chracters to be shown in lower case letteres (eg. regn value 't' in below code),
Code: |
SELECT
WHEN region = 'TEST' THEN DO
regn = 't' |
The regn value will be set in dynamic JCL as below
Code: |
QUEUE '//JVEDTSAR EXEC '||procver||'
QUEUE '// SUBMINP='''||in_dsn||'('||membr||')'',
QUEUE '// S5PARM='''||comp||accmo||accyr||' 'LEFT(membr,16,' ')
QUEUE '//S120.SYSIN DD DSN='||cclib||'(CP95115C),DISP=SHR
QUEUE '//S130.STDENV *
QUEUE 'Region='||regn||' |
When i put TRACE option, lower case is correctly shown, like Region=t, which is what required.
Code: |
*-* QUEUE '//JVEDTSAR EXEC '||procver||'
>>> "//JVEDTSAR EXEC CPT11103
*-* QUEUE '// SUBMINP='''||in_dsn||'('||membr||')'',
>>> "// SUBMINP='I90113.D54DC.CSPI.COMP.DATA(C701OSL2)',
*-* QUEUE '// S5PARM='''||comp||accmo||accyr||' 'LEFT(membr,16,
>>> "// S5PARM='00810612 C701OSL2 01',"
*-* QUEUE '//S120.SYSIN DD DSN='||cclib||'(CP95115C),DISP=SHR
>>> "//S120.SYSIN DD DSN=TEST.CONTROL(CP95115C),DISP=SHR
*-* QUEUE '//S130.STDENV *
>>> "//S130.STDENV *
*-* QUEUE 'Region='||regn||'
>>> "Region=t |
After writing to a Dataset which is allocated thru Rexx, and when we open the dataset it showing as REGION=T
I believe when the dataset is allocated CAPS ON is in place. Is there any way to overide with CAPS OFF
As per earlier not i have put below statement after the data set is apllocated, but it didn't work
ADDRESS ISPEXEC 'EDIT DATASET('DSNNAME') MACRO(CAPS OFF)'
I gone through internet, but didn't get a solution
Appreciate yoy whole some support. I hope the information provided helps to give a solution
Thanks |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
it works for me ...
Code: |
EDIT ENRICO.ISPF.EXEC(ZQ) - 01.04 Columns 00001 00072
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 /*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000002 /* */
000003 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000004 Trace "O"
000005
000006 lower = "lower"
000007 upper = "UPPER"
000008
000009 queue lower
000010 queue upper
000011 queue ""
000012
000013 Address TSO "ALLOC FI(OUT) DS(ENRICO.MFTESTS.PS) SHR REUSE"
000014
000015 Address TSO "EXECIO * DISKW OUT (FINIS"
000016
000017 Address TSO "FREE FI(OUT) "
000018
000019 Exit 0
000020
****** **************************** Bottom of Data **************************** |
Code: |
EDIT ENRICO.MFTESTS.PS Columns 00001 00072
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
==MSG> -CAUTION- Profile changed to CAPS OFF (from CAPS ON) because data
==MSG> contains lower case characters.
000001 lower
000002 UPPER
****** **************************** Bottom of Data **************************** |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
We know what your requirement is as it relates to the "t". We don't know why you are doing various things you are doing (like trying to convert it from uppercase to lowercase) but we know why your "t" has become a "T".
Forget the CAPS stuff for this. It is a Red Herring.
Quote: |
PULL
Code: |
PULL ;
template_list |
PULL reads a string from the head of the external data queue. It is just a short
form of the instruction:
Code: |
PARSE UPPER PULL ;
template_list
|
|
That is the bit from the manual which Pedro suggested you locate.
When you use PULL it is exactly the same as if you code PARSE UPPER PULL. Guess what the UPPER does? I suggest you follow Pedro's suggestion and read the manual.
If you are only going to look at the Trace output as far as you feel like, what was the point? You need to look at it until the data "goes bad", not until it passes the code that you "know" is wrong with everything (except perhaps the Region=, that is now unclear what is OK for you) OK. |
|
Back to top |
|
|
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
The example which enrico posted worked for me too
however when i tried with another small example it didn't give the expected result
sample example
Code: |
/*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Trace "O"
ADDRESS TSO
queue '//JVEDTSAR EXEC CPT11103 '
queue '//S130.STDENV * '
queue 'Region=t '
"ALLOC FI(OUTFILE) NEW SP(1 1) TR DSORG(PS) RECFM(F B)
LRECL(80) DSN('I90113.TEST.NEW1')"
maxbuf = queued()
DO indx = 1 TO maxbuf BY 1
PULL record
IF record > '' THEN
queue record /* only want records other than null or spaces */
END
queue ""
"EXECIO * DISKW OUTFILE (FINIS"
"FREE FI(OUTFILE) "
Exit 0 |
contents in dataset I90113.TEST.NEW1
Code: |
File Edit Edit_Settings Menu Utilities Compilers Test Help
--------------------------------------------------------------------
ISOE I90113.TEST.NEW1 Columns 0
Command ===> Scroll
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6-
****** ***************************** Top of Data *******************
==MSG> -Warning- The UNDO command is not available until you change
==MSG> your edit profile using the command RECOVERY ON.
000001 //JVEDTSAR EXEC CPT11103
000002 //S130.STDENV *
000003 REGION=T |
Since i am novice in Rexx, is it anything related to writing from Queue
Appreciate the support |
|
Back to top |
|
|
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
Region=t, mentiond in the queue, got changed to REGION=T, when displayed in the dataset |
|
Back to top |
|
|
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
Referring on PARSE option in net, i gave it as below, but it threw syntax error oin PARSE Statement
Code: |
maxbuf = queued()
DO indx = 1 TO maxbuf BY 1
PARSE CASELESS PULL record
IF record > '' THEN
queue record /* only want records other than null or spaces
END |
|
|
Back to top |
|
|
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
it worked finally
removed CASELESS and just gave as below
Thank you all for your adequate support |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
any reason to go thru the queue/pull shit, when You just re-process the data You just queued ?
since You do the queue, just queue only the things You need ! |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Why did you specify CASELESS? This parameter is for Object Rexx only.
See what happens if you just code PARSE PULL.
Garry. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Expect some problems with this part too:
Sumeendar wrote: |
Code: |
queue '//S130.STDENV * '
|
|
It is missing something...
And I'd like to see the answer to this question:
enrico-sorichetti wrote: |
any reason to go thru the queue/pull shit, when You just re-process the data You just queued ? |
|
|
Back to top |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
Quote: |
As per earlier not i have put below statement after the data set is apllocated, but it didn't work
ADDRESS ISPEXEC 'EDIT DATASET('DSNNAME') MACRO(CAPS OFF)'
I gone through internet, but didn't get a solution |
On the internet, I found the possible reason why you could not get to a caps off profile.
Presumably, 'CAPS OFF' Macro didn't work because you are limited to only one word macro name. And since 'CAPS OFF' are 2 words, it didn't work.
You need to try this:
var1='OFF'
"EDIT DATASET('DSNNAME') MACRO(CAPS) PARM(VAR1)"
and see if it works for you this way
. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
the discussion about CAPS ON/OFF is completely unrelated and irrelevant for the original issue...
getting the ISPF warning will simply depend on the workflow ...
for the sample I posted the sequence
running the script
editing the file will result in the warning message (sometimes !)
exiting with cancel
RE-editng the file will not give the warning
because even with the cancel the ISPF edit profile based on the last qualifier will have been saved |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
'CAPS OFF' Macro didn't work because you are limited to only one word macro name. And since 'CAPS OFF' are 2 words, it didn't work. |
The 'macro name' parameter should be (wait for it...) the name of a macro! Where the macro is the name of a member from SYSEXEC, SYSPROC, or the name of a compiled program.
It will not work to specify the name of a editor macro service name instead of the member name. |
|
Back to top |
|
|
|