View previous topic :: View next topic
|
Author |
Message |
vidyaa
New User
Joined: 02 May 2008 Posts: 77 Location: chennai
|
|
|
|
hi,
Is that possible to open copy book in fileaid from program using rexx |
|
Back to top |
|
|
rakesh17684
New User
Joined: 08 Oct 2006 Posts: 61 Location: San Diego
|
|
|
|
vidyaa,
can u elaborate the same question a bit more..
In case u want to open the Copy book from a cobol prog in view/browse mode i got a rexx macro for doing it |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
If you go ahead and post the rexx code, Vidya can reply and let us know if it does what is requested. It may help someone else with a similar requirement as well. |
|
Back to top |
|
|
ashishsr123
New User
Joined: 06 May 2008 Posts: 33 Location: Chennai
|
|
|
|
Hi rakesh
Can you please post the code .i also need it.
Thanks!
Ashish |
|
Back to top |
|
|
rakesh17684
New User
Joined: 08 Oct 2006 Posts: 61 Location: San Diego
|
|
|
|
Sry for the delay guys.. This something i coded on the go.. what all u need to do add this to ur macro directory or ur ISPF lib.. and then save it as member with a easy member name u like ex. 'cbk' and once u are in the program place your cursor on the member and type 'cbk'
Code: |
/*REXX FOR VIEW THE COPYBOOK FROM COBOL PROG */
ADDRESS ISREDIT
'MACRO'
'(LNUM) = LINENUM' .ZCSR
'(LNDATA) = LINE' LNUM
LNDATA = STRIP(LNDATA)
DSPOS = POS('COPY',LNDATA)
IF DSPOS = 0 THEN SIGNAL INCLUDE
LASTPOS = POS('.',SUBSTR(LNDATA,DSPOS+5))
MEMBER = SUBSTR(LNDATA,DSPOS+5,LASTPOS-1)
MEMBER = STRIP(MEMBER)
DSNAME = 'HLQ.DIR.COPYLIB('||MEMBER||')' ----> THE PDS WHERE THE COPYBOOKS ARE PRESENT
ADDRESS ISPEXEC
/* ADDRESS ISREDIT */
"BROWSE DATASET('"DSNAME"')"
/* "COPY '"DSNAME"'" */
EXIT
INCLUDE:
DSPOS = POS('INCLUDE',LNDATA)
IF DSPOS = 0 THEN SIGNAL ERROR_MSG
PARSE VAR LNDATA INCLUDE DCLGEN
MEMBER = DCLGEN
MEMBER = STRIP(MEMBER)
DSNAME = 'HLQ.DIR.COPYLIB('||MEMBER||')' ----> THE PDS WHERE THE COPYBOOKS ARE PRESENT
ADDRESS ISPEXEC
"BROWSE DATASET('"DSNAME"')"
EXIT
/* ZEDSMSG = "PRESS F3 TO GO BACK "
ZEDLMSG = "TO GO BACK - PLEASE PRESS F3 "
ADDRESS ISPEXEC "SETMSG MSG(ISRZ001)" */
/* DATAVAR = '-----------------------------------'
"ISREDIT LINE_AFTER .ZCSR = INFOLINE (DATAVAR)"
DATAVAR = ' PRESS F3 TO GO BACK '
"ISREDIT LINE_AFTER .ZCSR = INFOLINE (DATAVAR)"
DATAVAR = '-----------------------------------'
"ISREDIT LINE_AFTER .ZCSR = INFOLINE (DATAVAR)" */
ERROR_MSG:
/* ZEDSMSG = "CURSOR POSITION ERROR "
ZEDLMSG = "PLACE THE CURSOR OVER THE COPY VERB "
ADDRESS ISPEXEC "SETMSG MSG(ISRZ001)" */
ZERRSM='CURSOR POSITION ERROR'
ZERRLM= ' PLACE THE CURSOR OVER THE COPY VERB'
ZERRHM='*'
ZERRALRM='YES'
ADDRESS ISPEXEC 'SETMSG MSG(ISRZ002)'
/* DATAVAR = 'PLACE THE CURSOR OVER THE COPY VERB'
"ISREDIT LINE_AFTER .ZCSR = INFOLINE (DATAVAR)" */
EXIT
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Rakesh,
Thank you for posting your code
d |
|
Back to top |
|
|
ashishsr123
New User
Joined: 06 May 2008 Posts: 33 Location: Chennai
|
|
|
|
Hi Rakesh,
I have changed the pds to pds where all copy books are kept.
Code: |
DSNAME = 'HLQ.DIR.COPYLIB('||MEMBER||')' ----> THE PDS WHERE THE COPYBOOKS ARE PRESENT |
Now I am running the code with the following command.
Code: |
tso exec 'ash.TEST.REXX(CBK)' |
first I wrote the above commant(on the command line) and then placed the cursor over the copybook and hit Enter.
I get following error.
Code: |
CURSOR POSITION ERROR |
Kindly help to get rid of the error.
Note: I will keep the code in standard library after wards. I first want to test it keeping it in my personal PDS. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
Note: I will keep the code in standard library after wards. |
when asking and having received code, people should not rely on the code provider help afterward
code is posted as a courtesy and as an example on how to proceed
never as a finalized ready to run production code
the environments are usually different, and some tailoring must be carried on
the receiver should make sure that he understands the code and it' s implications
and has enough knowledge of the language the tool is written in
the script is not that complicated to debug and modify
the message and the reason are pretty clear to me
since You are a tool developer, You should be able to find it Yourself
run with trace on and try to understand why You get the message |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
Kindly help to get rid of the error |
Hi Rakesh,
welcome to the land of support -
give a rookie some code and you are continually supporting it.
ashish srivastava,
after taking 5 seconds to wade thru this 'enormous' REXX Macro,
I was finally able to determine that
Quote: |
CURSOR POSITION ERROR
|
will be displayed when the line on which you positioned your cursor did not have either |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
ashishsr123 wrote: |
Now I am running the code with the following command.
Code: |
tso exec 'ash.TEST.REXX(CBK)' |
first I wrote the above commant(on the command line) and then placed the cursor over the copybook and hit Enter.
I get following error.
Code: |
CURSOR POSITION ERROR |
|
This is because you are telling TSO to run an ISPF macro.
You should enter only the macro name (CBK) on the command line of the EDIT or VIEW panels.
The library 'ash.TEST.REXX' should be allocated to SYSEXEC DD. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
releasing the <thing> for general use would suggest to check for proper
invocation environment
and issuing the proper messages
1) check if the ispf environment is active ( sysvar(SYSISPF) = "ACTIVE" )
2) check the return code of "ISREDIT MACRO
the manuals ..
TSO/E bookshelf for the sysvar
ISPF bookshelf for the ISREDIT
will give enough info to proceed |
|
Back to top |
|
|
rakesh17684
New User
Joined: 08 Oct 2006 Posts: 61 Location: San Diego
|
|
|
|
Quote: |
The library 'ash.TEST.REXX' should be allocated to SYSEXEC DD |
Marso is correct.. |
|
Back to top |
|
|
vidyaa
New User
Joined: 02 May 2008 Posts: 77 Location: chennai
|
|
|
|
Thank you...the macro you have given will open the member from the library we specify but i need to open the copybook from the fileaid using option 8 which will show us the length of each fields form within the program... |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Vidya,
Since it appears that you are having problems deciphering all the hieroglyphics of a pure copybook
(Pic clause, interpreting length based on Pic clause, numeric types, etc)
you could do a split screen or START
and access FILEAID from the other session.
That way you could see the program and the 'readable' form of the copybook.
in other words have both, instead of invoking Fileaid from within the program.
FileAid with copybooks is normally used to display a file contents.
using a third session, you could view the compile output,
which would provide you with the offsets of fields within the program W-S and Linkage. |
|
Back to top |
|
|
|