IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Display in lowercase in dynamic JCL


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sumeendar

New User


Joined: 31 Jan 2006
Posts: 39

PostPosted: Mon Jul 06, 2015 12:44 pm
Reply with quote

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
View user's profile Send private message
Smita.t2

New User


Joined: 17 Apr 2012
Posts: 31
Location: Bangalore

PostPosted: Mon Jul 06, 2015 12:50 pm
Reply with quote

Try ISPF edit macro Caps off.

Code:
ADDRESS ISREDIT "CAPS OFF"
Back to top
View user's profile Send private message
Sumeendar

New User


Joined: 31 Jan 2006
Posts: 39

PostPosted: Mon Jul 06, 2015 1:04 pm
Reply with quote

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
View user's profile Send private message
Smita.t2

New User


Joined: 17 Apr 2012
Posts: 31
Location: Bangalore

PostPosted: Mon Jul 06, 2015 1:29 pm
Reply with quote

After dataset allocation, code something like this
Code:
ADDRESS ISPEXEC 'EDIT DATASET('DSNNAME') MACRO(CAPS OFF)'
Back to top
View user's profile Send private message
Sumeendar

New User


Joined: 31 Jan 2006
Posts: 39

PostPosted: Mon Jul 06, 2015 2:58 pm
Reply with quote

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
View user's profile Send private message
Sumeendar

New User


Joined: 31 Jan 2006
Posts: 39

PostPosted: Mon Jul 06, 2015 3:14 pm
Reply with quote

Also when i open the dataset in view mode and give PROF it says CAPS ON.
CAPS OFF yet to activate
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Jul 06, 2015 4:37 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Jul 06, 2015 9:55 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Tue Jul 07, 2015 1:41 am
Reply with quote

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
View user's profile Send private message
Sumeendar

New User


Joined: 31 Jan 2006
Posts: 39

PostPosted: Tue Jul 07, 2015 10:55 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jul 07, 2015 11:59 am
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jul 07, 2015 12:03 pm
Reply with quote

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
View user's profile Send private message
Sumeendar

New User


Joined: 31 Jan 2006
Posts: 39

PostPosted: Tue Jul 07, 2015 3:16 pm
Reply with quote

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
View user's profile Send private message
Sumeendar

New User


Joined: 31 Jan 2006
Posts: 39

PostPosted: Tue Jul 07, 2015 3:19 pm
Reply with quote

Region=t, mentiond in the queue, got changed to REGION=T, when displayed in the dataset
Back to top
View user's profile Send private message
Sumeendar

New User


Joined: 31 Jan 2006
Posts: 39

PostPosted: Tue Jul 07, 2015 3:37 pm
Reply with quote

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
View user's profile Send private message
Sumeendar

New User


Joined: 31 Jan 2006
Posts: 39

PostPosted: Tue Jul 07, 2015 3:43 pm
Reply with quote

it worked finally
removed CASELESS and just gave as below

Code:
PARSE PULL record   


Thank you all for your adequate support
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jul 07, 2015 3:56 pm
Reply with quote

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
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Tue Jul 07, 2015 6:49 pm
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Jul 07, 2015 7:46 pm
Reply with quote

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
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Tue Jul 07, 2015 9:08 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jul 07, 2015 9:22 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Tue Jul 07, 2015 11:04 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts JCL Dynamic System Symbols JCL & VSAM 3
No new posts Synctool-dynamic split job for varyin... JCL & VSAM 7
No new posts How to display the leading zeros of a... DB2 7
No new posts Dynamic file allocation using JCL JCL & VSAM 8
Search our Forums:

Back to Top