Blank out symbolic variables from PROC



TSO Programming, ISPF, SDF, SDSF and PDF, FTP, TCP/IP Concepts, SNA & SNA/IP etc...

Blank out symbolic variables from PROC

Postby vinu78 » Thu Oct 02, 2008 9:39 am

//TSTA310 PROC ENVI2='ABC#UA.R2.ST09',
// SYSG='HLED',
// PLUS1='(+1)'
//TST2310E EXEC PGM=ICEGENER,COND=(0,NE)
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=&HLQAI..&DMC2..&SYSG..PCTRSAS.LOAD,DISP=SHR
//SYSUT2 DD DSN=&HLQAO..&DMC2..&SYSG..&PRC..PCTRSAS.COPY&PLUS1,
// DISP=(,CATLG,DELETE),
// SPACE=(TRK,(5,2),RLSE),
// DCB=(GDG,LRECL=80,BLKSIZE=0,RECFM=FB),
// UNIT=DISK
//SYSIN DD DUMMY
//*
My reqt is to blank out the symbolic variable HLED from the above PROC
My approach was to search for '=FLED' and then get the corresponding parm parameter (SYSG). Then do a search for &SYSG.. and blank out that.
But the problem is when we use the statement
FULLPARM = "&"||SYSG||".."
"ISREDIT C &FULLPARM '' ALL NX"

it is blanking out only periods (.) and not the literals. Could you plz help in this issue.

Code
BLANKRC = 0                                                         
"ISREDIT CURSOR = 1 1"                                               
"ISREDIT C '7D'X  '~' ALL"       /* converting inverted comma to tilde char for finding the variable within the inverted comma
DO WHILE (BLANKRC = 0)                                               
   "ISREDIT F '=~HLED~' FIRST"                                             
    BLANKRC = RC                                                     
    IF BLANKRC = 0 THEN                                               
       DO                                                             
        "ISREDIT (LINE) = LINENUM .ZCSR"                             
        "ISREDIT (BLNKLNE) = LINE .ZCSR"                             
         PARSE VAR BLNKLNE '//' BLNKLNES                             
         BLNKLNES = STRIP(BLNKLNES)                                 
         DO WHILE(BLNKLNES <> '')                                   
            PARSE VAR BLNKLNES BLNKLNE1 "=" BLNKLNE2 "~," BLNKLNES   
            IF BLNKLNE2 = '~HLED' THEN                               
               DO                                                   
                    FULLPARM = "&"||BLNKLNE1||"!!"             
                   "ISREDIT C &FULLPARM '' ALL NX"             
               END                                           
        END                                                 
       END                                                     
END           
"ISREDIT C '~' '7D'X ALL"                                           
RETURN 0                                 

Plz help me to blank out &SYSG..

Thanks
Vinu
vinu78
 
Posts: 29
Joined: Sat Sep 27, 2008 4:47 am
Has thanked: 0 time
Been thanked: 0 time

Re: Blank out symbolic variables from PROC

Postby Gilles » Fri Oct 31, 2008 8:43 pm

There seems to be a problem when an & character is passed in the argument of the CHANGE command. I couldn't find how to make the CHANGE command accept it. But your code gave me the idea of trying to change the character string in hexadecimal instead. I tried in and it worked. I'm giving you just these few lines so you can adapt your macro if you so choose to use this technique. You convert your string to change in hexadecimal with the C2X function and run the CHANGE command with the result as the argument.

STRINGTOCHANGE = C2X('&SYSG..')
"ISREDIT C '"STRINGTOCHANGE"'X '' ALL"
Gilles
 
Posts: 16
Joined: Mon Sep 29, 2008 6:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Blank out symbolic variables from PROC

Postby vinu78 » Thu Nov 06, 2008 1:23 am

Thanks..That worked out.
Also we can change the & to some other character like tilde or ? and then do the operation.
For macros, the & is a special case
vinu78
 
Posts: 29
Joined: Sat Sep 27, 2008 4:47 am
Has thanked: 0 time
Been thanked: 0 time


Return to TSO & ISPF

 


  • Related topics
    Replies
    Views
    Last post