View previous topic :: View next topic
|
Author |
Message |
Sikkandhar
New User
Joined: 03 Dec 2007 Posts: 61 Location: Bangalore
|
|
|
|
Hi,
I would like to know how to convert all the occurences of a particular string from a particular point in a COBOL program. For example, a string "Variable1" is there in a cobol program. I would like to convert this string "Variable1" to "Var1" after Data Division.
Occurences before Data Division should be ignored
Thanks |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Using the ISPF Editor, can't you just exclude the lines up to the end of the DATA DIVISION, then use the change command C 'Variable1' 'Var1' NX ALL?
Or, if you were to use a regular TSO/E EDIT, if you were to use the FIND command to locate the point in the data where you want to start, then any command you issue is from that point forward, i.e. C * 999999 /Variable1/Var1/ is going to be done from the current row pointer forward. |
|
Back to top |
|
|
Sikkandhar
New User
Joined: 03 Dec 2007 Posts: 61 Location: Bangalore
|
|
|
|
Thanks Superk
But if i use "C 'Variable1' 'Var1' NX ALL", all the occurrences are getting converted.
And "C * 999999 /Variable1/Var1/" converts the the variable Variable on the current line to "999999/Variable/Var1"
Currently i use this command to get the line number where Data Division starts
"ISREDIT F ALL 'DATA DIVISION' "
LINA=""
ADDRESS ISREDIT "(LINA) = LINENUM .ZCSR"
I would like to change the occurence of Variable1 to Var1 after this line number |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
You might "label" the COBOL code after Data Division as ".A .. .B" then
Code: |
C ALL "VAR1" "VAR2" .A .B |
. Try this in view mode or on some other (back-up) DSN - if satisfied with the end results, proceed. |
|
Back to top |
|
|
Sikkandhar
New User
Joined: 03 Dec 2007 Posts: 61 Location: Bangalore
|
|
|
|
Thanks Anuj.
Can you please get me syntax for labelling a line or link for TSO/ISPF commands |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
Just an example:
Code: |
000003 //*
.A //**************************************************************
000005 //JS001 EXEC UCC11RMS,PARM=F
000006 //**************************************************************
000007 //*
000008 // SET YDATE=D080808
.B //*
000010 //EMAIL EXEC PGM=IKJEFT01,REGION=0M,PARM='%MYEXEC &YDATE' |
Check the position of ".A" & ".B" (placed in line numbers, on left side of the code), they are labels. |
|
Back to top |
|
|
Sikkandhar
New User
Joined: 03 Dec 2007 Posts: 61 Location: Bangalore
|
|
|
|
I have to label a program through a mAcro in Rexx and then have to change the occurence of the variable from that point through REXX |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
oh..you ball me out, I don't speak REXX much and thread being in TSO/ISPF part of the forum (instead of being in CLIST/REXX part of the frorm) made me to suggest about labels.
For Label thing you might look at this thread: ibmmainframes.com/viewtopic.php?t=9123&highlight=label |
|
Back to top |
|
|
|