Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
opening copybook from program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
vidyaa

New User


Joined: 02 May 2008
Posts: 77
Location: chennai

PostPosted: Sat Apr 25, 2009 3:05 am    Post subject: opening copybook from program
Reply with quote

hi,

Is that possible to open copy book in fileaid from program using rexx
Back to top
View user's profile Send private message

rakesh17684

New User


Joined: 08 Oct 2006
Posts: 60
Location: San Diego

PostPosted: Sat Apr 25, 2009 1:08 pm    Post subject:
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Apr 25, 2009 8:30 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ashishsr123

New User


Joined: 06 May 2008
Posts: 33
Location: Chennai

PostPosted: Sun Apr 26, 2009 4:15 pm    Post subject:
Reply with quote

Hi rakesh

Can you please post the code .i also need it.

Thanks!
Ashish
Back to top
View user's profile Send private message
rakesh17684

New User


Joined: 08 Oct 2006
Posts: 60
Location: San Diego

PostPosted: Mon Apr 27, 2009 11:11 am    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Apr 27, 2009 11:24 am    Post subject: Reply to: opening copybook from program
Reply with quote

Hi Rakesh,

Thank you for posting your code icon_smile.gif

d
Back to top
View user's profile Send private message
ashishsr123

New User


Joined: 06 May 2008
Posts: 33
Location: Chennai

PostPosted: Mon Apr 27, 2009 4:50 pm    Post subject:
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10373
Location: italy

PostPosted: Mon Apr 27, 2009 5:05 pm    Post subject: Reply to: opening copybook from program
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Apr 27, 2009 5:07 pm    Post subject:
Reply with quote

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
  • COPY
  • INCLUDE
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1250
Location: Israel

PostPosted: Mon Apr 27, 2009 6:44 pm    Post subject:
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10373
Location: italy

PostPosted: Mon Apr 27, 2009 6:53 pm    Post subject: Reply to: opening copybook from program
Reply with quote

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
View user's profile Send private message
rakesh17684

New User


Joined: 08 Oct 2006
Posts: 60
Location: San Diego

PostPosted: Mon Apr 27, 2009 7:06 pm    Post subject:
Reply with quote

Quote:
The library 'ash.TEST.REXX' should be allocated to SYSEXEC DD


Marso is correct..
Back to top
View user's profile Send private message
vidyaa

New User


Joined: 02 May 2008
Posts: 77
Location: chennai

PostPosted: Mon Apr 27, 2009 7:52 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Apr 27, 2009 8:13 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 8 Wed Nov 15, 2017 4:27 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us