Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

'&' Character missing in ISREDIT LINE_AFTER

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Thu May 26, 2011 12:08 am    Post subject: '&' Character missing in ISREDIT LINE_AFTER
Reply with quote

I am trying to write a macro for expanding copybooks in COBOL. My cobol copybook contains the comment line -

Code:
*  NNN011 0401 ADDED M&E BAND AND MODEL CODE FOR FUND FILE      *


I am reading the copybook in a stem variable and when I print the stem variable its displaying the &. But when it is inserted by ISREDIT LINE_AFTER in my source code the '&E' are missing. I suspect it is taking it as an AND. I am writing it as a DATALINE. Any suggestions would be of great help.

And output is
Code:
*  NNN011 0401 ADDED M BAND AND MODEL CODE FOR FUND FILE      * 16


Here is the REXX MACRO part doing the same
Code:

CALL ALLOCATE_AND_READCPY_RTN
IF (RC =  0 & ERROR_PRESENT = 0) THEN DO
  DO  I = COPYDATA.0 TO 1 BY -1
   'ISREDIT LINE_AFTER .ZCSR = DATALINE "'COPYDATA.I'"'
  END
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu May 26, 2011 12:19 am    Post subject: Reply to: '&' Character missing in ISREDIT LINE_AFTER
Reply with quote

works for me

Code:
000025 coun   = 2
000026 line.1 = "some normal line"
000027 line.2 = "some not normal &  line"
000028 do i = 1 to coun
000029    work = line.i
000030    Address ISREDIT "LINE_AFTER .ZLAST = DATALINE (WORK)"
000031 End
000032



Code:
000025 coun   = 2
000026 line.1 = "some normal line"
000027 line.2 = "some not normal &  line"
000028 do i = 1 to coun
000029    Address ISREDIT "LINE_AFTER .ZLAST = DATALINE  '"line.i"' "
000030 End


both cases !
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Thu May 26, 2011 12:40 am    Post subject: Reply to: '&' Character missing in ISREDIT LINE_AFTER
Reply with quote

Can u try the specific "M&E" case because the '&' with spaces around was working for me also. Extremely sorry I should have given that information too.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu May 26, 2011 12:49 am    Post subject: Reply to: '&' Character missing in ISREDIT LINE_AFTER
Reply with quote

use the format I showed int the first snippet
Code:
Address ISREDIT "LINE_AFTER .ZLAST = DATALINE (WORK)"


in my code I never used anything else icon_biggrin.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu May 26, 2011 1:03 am    Post subject:
Reply with quote

& and other characters are hard to play with

i found that i needed to replace them with other characters (with translate),
do the line_after
and then do a edit macro change against the line inserted.

or simply do a change all with label range after the insertion is done.

apostrophies will also eat your lunch.

not at work now, but i used to have a list of char that could be found in cobol copybooks/source code that needed to be changed before the line_after/line_before, then a global change all when finished.

you can create your own list by creating a dummy copybook containing all char and see which give you a problem.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Thu May 26, 2011 1:05 am    Post subject: Reply to: '&' Character missing in ISREDIT LINE_AFTER
Reply with quote

Thanks a lot it worked with the first option you suggested. Though I am unable to understand the reason behind the same.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Thu May 26, 2011 1:09 am    Post subject:
Reply with quote

Hi Dick,

You mean I should translate & and all other special characters that appear in my copybook before writing. And then after they are written replace them with the original ones. In this case what would I translate them into since I do not have choice of letters and numbers which would be appearing in the copybook along with these?
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Thu May 26, 2011 1:14 am    Post subject:
Reply with quote

OK got the answer I think you edited your post later. Still its a major problem I would say. Was just curious to know why REXX language producers never corrected it?
Back to top
View user's profile Send private message
prino

Active Member


Joined: 07 Feb 2009
Posts: 982
Location: Oostende, Belgium

PostPosted: Thu May 26, 2011 1:19 am    Post subject:
Reply with quote

niks_jude wrote:
OK got the answer I think you edited your post later. Still its a major problem I would say. Was just curious to know why REXX language producers never corrected it?

It's not a REXX issue, it's an ISPF issue.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu May 26, 2011 1:20 am    Post subject:
Reply with quote

i often used a pound sign: #
the at-sign: @
§ also works.

you can create a macro: called 'chgthis'

/*REXX*/
isredit macro
chg all '@' '&' /* at-sign back to ampersand */
chg all "#" "'" /* pound sign back to apostrophe/quote */
chg all '§' '"' /* § back to double quotes
exit

which you can invoke from your rexx script after you have inserted the lines.

how you go about changing the values in the stem variables is up to you.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu May 26, 2011 1:27 am    Post subject:
Reply with quote

there are probably escape char that you can use,
but never found them,
did not look for them,
used my own method of substitution.

if you have more than 2 or three chars that give you trouble,
you may have to do each variable before the INSERT and then a change all on the line just inserted.

depends on how much garbage is in your copybooks.

that's the fun with writing these neat little tools, they need to be universal. (originally spelled it univeral - almost left if that way)

at my present site, we use endevor, and have 2 legs,
which means i can have copybooks comming from 7 potential libraries
need to have arguements
such as cobol type - batch, cics,
copybook library - unit, systems, acceptance, from 2 different legs and then prod.
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Thu May 26, 2011 1:39 am    Post subject: Reply to: '&' Character missing in ISREDIT LINE_AFTER
Reply with quote

Quote:
Was just curious to know why REXX language producers never corrected it?

and

It's not a REXX issue, it's an ISPF issue.


It is an ISPF feature! Use the SCAN OFF service to turn off the variable substitution.
Code:
ISREDIT "SCAN OFF"

Though, it is not as 'OFF' as I would have thought.

From the manual:
Quote:
Because the ISPEXEC call interface for REXX EXECs allows you to specify parameters as symbolic variables, a single scan always takes place before the syntax check of a statement. Therefore, the rule of using two ampersands (&) before variable names to avoid substitution of variable names also applies to REXX EXECs.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Thu May 26, 2011 1:50 am    Post subject:
Reply with quote

Hi Pedro,

Now I feel I can see the reason - When we pass variable in ISREDIT with brackets around it, its not scanned. Thanks.


Dick,
I think I will continue with what Enrico and Pedro have suggested, if still I encounter any problem I will have to go your way. Thanks a lot anyways.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu May 26, 2011 10:54 am    Post subject:
Reply with quote

i use instead of line_before/line_after the ISREDIT COPY macro command nowadays inorder to skip the problem.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Thu May 26, 2011 11:16 am    Post subject: Reply to: '&' Character missing in ISREDIT LINE_AFTER
Reply with quote

Thanks can try even that and it is more specific to my need.
Back to top
View user's profile Send private message
ravikanth

New User


Joined: 12 Jan 2006
Posts: 29

PostPosted: Mon Feb 27, 2012 11:29 pm    Post subject: Reply to: '&' Character missing in ISREDIT LINE_AFTER
Reply with quote

Never tried the "SCAN OFF" but does it only work with double ambersand or even single ambersand? Thank you!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. DSList (3.4) cannot display Chinese c... jacobdng TSO/ISPF 4 Wed Oct 05, 2016 2:51 pm
No new posts Continuation Character ballaswaroop SYNCSORT 8 Thu Aug 25, 2016 4:46 pm
No new posts Fault Analyser - missing code explana... egrove IBM Tools 1 Thu Aug 11, 2016 5:55 pm
No new posts Adding a descending character to a file Steve Ironmonger DFSORT/ICETOOL 3 Fri Jul 15, 2016 4:57 pm
No new posts Moving character data to smallint in db2 rikdeb DB2 5 Thu Jul 14, 2016 12:38 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us