View previous topic :: View next topic |
Author |
Message |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Wed Jun 13, 2007 12:50 am Post subject: Checking if the dataset is opened in VIEW mode.. |
|
|
Hi,
I am running an EDIT macro to expand the copybooks in the cobol program. But I dont want the dataset to be saved (By coming out of the dataset using PF key). To avoid this I am planning to run the MACRO only if the dataset is opened in VIEW mode. If its in EDIT mode, the macro should throw some error message before processing.
Is there any command that can be used in the EDIT MACRO to check if the dataset is opened in VIEW mode?
I have searched the FORUM for my requirement but couldnt find the solution I am looking for. If I have missed anything please direct me to the link. Thanks.
Regards,
Vivek Gangadharan. |
|
Back to top |
|
 |
prino Banned
Joined: 01 Feb 2007 Posts: 45 Topics: 5 Location: Oostende
|
Posted: Wed Jun 13, 2007 1:10 am Post subject: |
|
|
"isredit (MODE) = session"
Robert |
|
Back to top |
|
 |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Wed Jun 13, 2007 1:16 am Post subject: |
|
|
prino,
Its working perfect ! Thanks !
Regards,
Vivek G _________________ Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay) |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Wed Jun 13, 2007 2:48 am Post subject: |
|
|
vivek1983,
You could use NOTE lines to expand your copybooks, then you don't have to prohibit users that are in 'Edit mode' from having/enjoying the expanded copybooks. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Tue Jun 19, 2007 3:58 am Post subject: |
|
|
Hi,
Below is my macro to expand copybooks and DCLGENS in the cobol program.
[code:1:7e504d5418]
/* REXX FOR EXPANDING COBOL PROGRAM 00010000
THIS WILL CREATE/REPLACE MEMBER WITH SAME NAME AS THE CURRENT ONE 00020000
IN THE USER SUPPLIED DSN OR DEFAULT ONE. EXAPLES TO INVOKE - 00030000
1 XPAND COMPLETE.DATASET.NAME 00040000
2 XPAND 00050000
*/ 00060000
00070000
ADDRESS ISREDIT 00080000
"MACRO (DSN)" 00090000
"(USERSTAT) = USER_STATE" 00100000
"(MEMBER) = MEMBER" 00110000
"REC ON" 00150000
"CAPS OFF" 00160000
"ISREDIT (MODE) = SESSION" 00161008
IF STRIP(MODE) \= 'VIEW' THEN DO 00163010
SAY 'MEMBER NOT OPENED IN VIEW MODE ! ' 00163108
EXIT 00163208
END 00164010
00170000
"FIND ' COPY ' 3 60 FIRST" 00190006
DO WHILE RC = 0 00200000
"(CURRLINE) = LINE .ZCSR" 00210000
IF SUBSTR(CURRLINE,7,1) \= '*' THEN DO 00211107
COPYBOOK_POS = WORDPOS('COPY',CURRLINE) + 1 00212007
COPYBOOK = WORD(CURRLINE,COPYBOOK_POS) 00220007
COPYBOOK_LEN = LENGTH(COPYBOOK) 00230007
IF SUBSTR(COPYBOOK,COPYBOOK_LEN,1) = '.' THEN 00240007
COPYBOOK = SUBSTR(COPYBOOK,1,(COPYBOOK_LEN-1)) 00250007
PATH = 'GIO.END.GPROD.COPYBOOK(' |
|
Back to top |
|
 |
acevedo Beginner

Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Tue Jun 19, 2007 5:45 am Post subject: |
|
|
AFAIK, you should read the copybook and insert noteline/infoline one by one.
something like:
Code: |
address tso "alloc fi(ddin) dsn('"yourpathhere"') shr reuse"
address tso "execio * diskr ddin(stem cpy."
address tso "execio 0 diskr ddin(finis"
address tso "free fi(ddin)"
do i=1 to cpy.0
"line_before .zcsr = noteline '"cpy.i"'"
end i
|
(not tested... )
hth |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Tue Jun 19, 2007 5:59 am Post subject: |
|
|
vivek1983,
as acevedo indicated, you can not insert NOTElines in a block. they must be individually inserted.
couple of things that I discovered doing this same sort of thing- inserting the complete 80 char might cause a problem. I always inserted chars 7 thru 71
- the manual suggests using &cpy.i to avoid parsing by the macro and ispf - check the manual- SC34-4820-03 (or whichever version is installed at your site.
- I set up the execio load of the copybook to a stem and the actual insert (line_before/after) as two separate rexx routines.
_________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Tue Jun 19, 2007 11:28 am Post subject: |
|
|
Code: | "line_before .zcsr = noteline '"cpy.i"'" | should be
Code: | v = cpy.i ; "line_before .zcsr = noteline (v)" | to avoid substitution problems |
|
Back to top |
|
 |
|
|