Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing question 1

Status
Not open for further replies.

Spaghetty

Technical User
Nov 30, 2005
11
NL
Hello,

I am sorry if I there is something that answers my question in this forum already.

I am new to rexx and am writing an Edit macro at the moment but also need some help.

What the macro should do is when you put the cursor under an Include/copydeck name in a source of a program, it should look (for the include) through the SYSLIBS for that particular language, and when it finds it should open a browse session, without leaving the current edit session of course.

I can get the language Definition name, and Include to look for. I want to parse the syslibs (Defined in the language definition) and then look for the include.

The syslibs are listed in a member in this format (with comments in front of it):

*********************************************************
* This is a Language Definition for SCLM.
*
* Language: COBOL DB2
*
*********************************************************

FLMSYSLB HLQ.XXX.YYY
FLMSYSLB HLQ.AAA.BBB
FLMSYSLB ALQ.TTT

FLMLANG COBOLDB2

.....
.....
---------------------------------------------------------

After parsing the source beeing edited, I get 2 importand values (i've assigned them to variables)
These Values are:

Language: COBOLDB2 (language definition where syslibs are, Could be many values but in this example lets assume I found COBOLDB2 is the Language Definition for SCLM)
Include: DCXXXXXX (found in source, Name is fictious)

I know the language definition members are located in ME.PROJDEFS.SOURCE(COBOLDB2)

Now I need to parse the DSN's located right after the string 'FLMSYSLB' of the Language definition member allocate those datasets and search for the DCXXXXXX include there. When found i want to open it in an Browse session.

I hope anyone understands what I mean.
I Would realy appreciate your Help!!

Thanks in advance,

Spaghetty
 
Sure. Can you read that member that has the SYSLIB DSNs? Let's say you've done a
Code:
"EXECIO * DISKR $SCLM (STEM DATA. FINIS"
and you now have all that text in 'data.'. Now all you have to do is collect the DSNs and check for the copybook member in each until you find it:
Code:
do zz = 1 to data.0
   if Word(data.zz,1) = "FLMSYSLB" then do 
      parse var data.zz . dsn .
      fulldsn = "'"dsn"("include")'"
      if SYSDSN(fulldsn) = "OK" then leave
      end  /* if word... */
end  /* zz */
if zz >= data.0 then,
   say "Sorry, I couldn't find" include "anywhere."
else,
   address ISPEXEC "VIEW DATASET("fulldsn")"

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Thanks for the Help.

I will show the little bit of rexx I have right now. It might be not the best way to code it but here it goes:

/*REXX *
* SCLM ZOOM EDIT MACRO
* BY
* EDUARDO
*
*----------------------------------------------------
TRACE I
ADDRESS ISREDIT 'MACRO'
ADDRESS ISREDTT '(ROW,COL) = CURSOR'
ADDRESS ISREDIT '(REGEL) = LINE' ROW
ADDRESS ISREDIT '(MEMBER) = MEMBER'
ADDRESS ISREDIT '(DS) = DATASET'

PARSE VAR DS PROJECT'.'GROUP'.'TYPE

'FLMCMD ACCTINFO,'PROJECT',,'GROUP','TYPE','MEMBER /* This gets information about the member beeing edited, after this I can use the variable ZSALANG, wich holds the name of the Language Definition where the SYSLIBS are located */

SELECT
WHEN WORDPOPS('COPY ',REGEL) <> 0 THEN
DO
X = WORDPOS('COPY ',REGEL)
X = X + 1
COPYDECK = WORD(REGEL,X)
CALL MESSAG
END
WHEN WORDPOS('INCLUDE ',REGEL) <> 0 THEN
DO
X = WORDPOS('INCLUDE ',REGEL)
X = X + 1
COPYDECK = WORD('INCLUDE ',X)
CALL MESSAG
END
OTHERWISE
SAY COPYDECK 'NOT FOUND, OR ILEGAL COPYDECK NAME'

MESSAG:

SAY COPYDECK 'FOUND!! LANGUAGE =' ZSALANG
RETURN

--------------------------------------------------------

This is my code till now. At this point the variable COPYDECK contains the name of include to search for, and the variable ZSALANG contains the member name where the syslibs should be gotten from, and that member is located at ME.PROJDEFS.SOURCE

This just to make clear to you where I am at. Where does your code fit into this? Should the "include" in your code be changed to "COPYDECK" ? Where do you look through the found syslibs in your code?

Its a bit too advanced for me :)

TIA,

Eduardo

 
What did you mean with all that text in '.data' ?

what is all that text?

sorry but this is my first rexx program ever, and I havent even done the hello world yet.

Thanks,

Eduardo
 
You said
The syslibs are listed in a member in this format... Now I need to parse the DSN's located right after the string 'FLMSYSLB' of the Language definition member allocate those datasets and search for the DCXXXXXX include there. When found i want to open it in an Browse session.

You have to read that member, don't you, to find out the names of the SYSLIB datasets? You'll do that with EXECIO. You have to parse each FLMSYSLB line and check that dataset to see if it contains the copybook member. You'll do that with SYSDSN.

I used VIEW instead of BROWSE; you can use whatever suits your mood.


Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Thanks a lot Rexxhead.

I will try this tomorrow, when i get back to work, I'll post how it went.

Realy appreciate your help,

Eduardo

 
Thanks a lot Frank!!

It is working now, and that is more then I had expected for today!

My code looks like this now:

Code:
/*REXX                                                       *
 * SCLM ZOOM EDIT  MACRO                                         *
 *  BY                                                           *
 * EDUARDO SERRANO                                              *
 * DECEMBER 2005                                                *
 *                                                              *
 *--------------------------------------------------------------*/
TRACE
  ADDRESS ISREDIT 'MACRO'
  ADDRESS ISREDIT '(ROW,COL) = CURSOR'
  ADDRESS ISREDIT '(REGEL) = LINE' ROW
  ADDRESS ISREDIT '(MEMBER) = MEMBER'
  ADDRESS ISREDIT '(DS) = DATASET'

PARSE VAR DS PROJECT'.'GROUP'.'TYPE

'FLMCMD ACCTINFO,'PROJECT',,'GROUP','TYPE','MEMBER

SELECT
  WHEN WORDPOS('COPY ',REGEL) <> 0 THEN
    DO
       X = WORDPOS('COPY ',REGEL)
       X = X + 1
       COPYDECK = WORD(REGEL,X)
       CALL SUCCESVOL
       CALL ZOOMINCLUDE
    END
  WHEN WORDPOS('INCLUDE ',REGEL) <> 0 THEN
    DO
       X = WORDPOS('INCLUDE ',REGEL)
       X = X + 1
       COPYDECK = WORD(REGEL,X)
       CALL SUCCESVOL
       CALL ZOOMINCLUDE
    END
  OTHERWISE
       CALL NIETSUCCESVOL
 RETURN

/*! NIETSUCCESVOL *****************************************************
 *                                                                    *
 *  SHOW MESSAGE THAT THE COPYDECK WAS NOT FOUND.                         *
 *  NOTHING SPECIAL, JUST PRACTICING.                                 *
 *                                                                    *
 **********************************************************************/

NIETSUCCESVOL:

    SAY COPYDECK 'NIET GEVONDEN! CONTROLEER CURSOR POSITIE!!'
  RETURN

/*! SUCCESVOL *********************************************************
 *                                                                    *
 *  SHOW MESSAGE THAT THE COPYDECK WAS FOUND.                         *
 *  NOTHING SPECIAL, JUST PRACTICING.                                 *
 *                                                                    *
 **********************************************************************/

SUCCESVOL:

  SAY COPYDECK 'GEVONDEN!!  TAAL= ' ZSALANG
  RETURN

/*! ZOOMINCLUDE *******************************************************
 *                                                                    *
 *   THIS READS ALL LINES IN THE LANGUAGE DEFINITION FOR THE MEMBER   *
 *        BEEING EDITED AND PUTS ALL LINES IN VARIABLE DATA.0         *
 *  AFTER THIS, IT PARSES DATA.0 AND GETS ALL SYSLIBS DATASET NAMES.  *
 *   IT THEN LOOKS FOR THE LANG. DEFINITION MEMBER (ZSALANG) IN THE   *
 *     SYSLIBS FOUND. LAST BUT NOT LEAST IT OPENS THE INCLUDE IN      *
 *                            VIEW-MODE.                              *
 *                                                                    *
 **********************************************************************/

ZOOMINCLUDE:

ZSALANG = '('ZSALANG')' /* I WAS HAVING PROBLEMS WITH QUOTES LOL */

   SAY ZSALANG

"FREE F (SCLMLD) DS('$A343.PROJDEFS.SOURCE"ZSALANG"'"

"ALLOC F (SCLMLD) SHR DS('$A343.PROJDEFS.SOURCE"ZSALANG"'"

"EXECIO * DISKR SCLMLD (STEM DATA. FINIS"

DO ZZ = 1 TO DATA.0

   IF WORD(DATA.ZZ,1) = "FLMSYSLB" THEN DO

      PARSE VAR DATA.ZZ . DSN .

      FULLDSN = "'"DSN"("COPYDECK")'"

      IF SYSDSN(FULLDSN) = "OK" THEN LEAVE

   END  /* IF WORD... */

END  /* ZZ */

IF ZZ >= DATA.0 THEN,

   SAY "SORRY, I COULDN'T FIND" COPYDECK "ANYWHERE."

ELSE,

   ADDRESS ISPEXEC "VIEW DATASET("FULLDSN")"

I have another question though.
The exec does what I want so I am happy with that.

What I wanted to know is, is there a way to stop the parsing for syslibs whenever the string "FLMLANGL" is found and jump to the Searching part?

I have tried adding a

Code:
IF WORD(DATA.ZZ,1) = "FLMLANGL" THEN LEAVE

Before the:

Code:
IF WORD(DATA.ZZ,1) = "FLMSYSLB" THEN DO

But it doesnt work.

Another thing i noticed is that if the exec abends, the DDNAME wich was allocated stays allocated and next time when I issue an ALLOC it gives an error that file is in use.

I added a FREE in front of the alloc, and it is alright, but only when it is indeed still allocated. If the DDNAME isnt allocated it also issues an error "COULD NOT FREE DATASET NOT ALLOCATED" or something similar, wich is obvious.

Is there a way to let my exec stop parsing when it finds "FLMLANGL"?

Is there a way to test if a ddname is allocated and then take proper actions?

Excuse me if this is simple for you guys. I have tryed a couple of ways and didnt get it to work.

Thank you,

Eduardo
 
When I look at the data that lists the SYSLIBs I don't see "FLMLANGL". I see "FLMLANG". Are you looking for the right thing?

As to ALLOC, I always
Code:
"ALLOC FI(...) DA(....) SHR REUSE"
REUSE says "I understand that this file may already be allocated to something else, but I want to use it anyway". It is like issuing a FREE ahead of the ALLOC, but it doesn't generate any messages.

When you FREE a file, you also free the dataset associated with it. In your FREE above, by the time the system went to free the DATASET, it had already bee FREEd, so you got a message. "File" and "dataset" are different things in MVS.


Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Hello Frank,

Thanks again for your reply.

I will do The alloc fi(...) da(...) shr reuse method.

As for the other question, Yes I am looking for the right thing. Whenever the string FLMLANGL is found, I am sure that no FLMSYSLB will be found in the rest of that member.

Thats why i wanted it to stop right after it found FLMLANGL

By the way, would that be the right way to code it?

Code:
IF WORD(DATA.ZZ,1) = "FLMLANGL" THEN LEAVE

My program is getting kind of buggy now, as I am trying to make it better. I guess I should just keep my hands off of it.

This is how it looks now:

Code:
/*  REXX  *************  GENERAL NOTES  *******************************
 *                                                                    *
 *    SCLM EDIT-MACRO VOOR HET ZOEKEN VAN INCLUDES IN EEN SOURCE.     *
 *    MEN KAN DIT DOEN DOOR OP DE COMMAND LINE HET COMMANDO 'LOEP'    *
 *    TE GEVEN EN MET DE CURSOR OP DE INCLUDE TE GAAN STAAN. HIERNA   *
 *    DRUKT U OP ENTER (CTRL) EN DE INCLUDE WORDT IN DE SYSLIBS       *
 *    VOOR DE BETREFFENDE TAAL OPGEZOCHT EN IN VIEW-MODE GEOPEND.     *
 *                                                                    *
 **********************   LEGAL NOTES   *******************************
 *                                                                    *
 *    THIS SCLM EDIT-MACRO IS A PROPERTY OF EDUARDO SERRANO BRITO     *
 *    SIMOES, ON BEHALF OF CORUS GROUP PLC. ANY USE OF THIS MACRO     *
 *       IS CONSIDERED ILLEGAL IF NOT EXCLUSIVELY PERMITTED BY        *
 *               MR. EDUARDO S.B.S OR CORUS GROUP PLC.                *
 *                                                                    *
 *                       !!! WARNING !!!                              *
 *                                                                    *
 *  ANY ILLEGAL USE OF THIS MACRO WILL BE PROSECUTED    *
 *                   TO THE FULL EXTENT OF THE LAW                    *
 *                                                                    *
 ********************* CUSTOMIZATION NOTES ****************************
 *                                                                    *
 *                                                                    *
 *         THIS EDIT-MACRO IS FOR USE INSIDE A SCLM EDITOR.           *
 *  USE OF IT OUTSIDE SCLM WILL RESULT IN ERRORS AS IT USES CERTAIN   *
 *    SCLM VARIABLES SUCH AS 'ZSALANG', WICH HOLDS THE NAME OF THE    *
 *         LANGUAGE DEFINITION FOR THE MEMBER BEEING BUILT.           *
 *                                                                    *
 *    FOR CUSTOMIZATION FOR INSIDE AN SCLM PROJECT:                   *
 *                                                                    *
 *         + CHANGE ALL OCCURANCES OF $A343 TO THE NAME OF YOUR       *
 *           SCLM PROJECT.                                            *
 *                                                                    *
 *         + THIS EXEC ASSUMES THE PROJECT HIERARCHY IS:              *
 *                                                                    *
 *           PROJECT.GROUP.TYPE                                       *
 *                                                                    *
 *         + IF YOUR SCLM PROJECT HIERARCHY IS DIFFERENT THEN YOU     *
 *           WILL HAVE TO CHANGE THE FIRST SECTION OF THE PROGRAM     *
 *           ACCORDING TO YOUR DEFINITION.                            *
 *                                                                    *
 *    VARIABLES:                                                      *
 *                                                                    *
 *         ZSALANG  ==>  CONTAINS THE NAME FOR THE LANG. DEFINITION   *
 *                       FOR THE MEMBER BEEING EDITED. IT IS USED TO  *
 *                       PARSE THE LANG. DEFINITION AND GET THE       *
 *                       SYSLIBS WHERE THE INCLUDES ARE LOCATED.      *
 *                                                                    *
 *         COPYDECK ==>  CONTAINS THE NAME OF THE INCLUDE THAT WE     *
 *                       WE WANT TO BROWSE.                           *
 *                                                                    *
 **********************************************************************/


TRACE

  ADDRESS ISREDIT 'MACRO'  /* DIT IS EEN MACRO */
  ADDRESS ISREDIT '(ROW,COL) = CURSOR' /* PAK CURSOR POSITIE */
  ADDRESS ISREDIT '(REGEL) = LINE' ROW /* PAK REGELNUMMER */
  ADDRESS ISREDIT '(MEMBER) = MEMBER'
  ADDRESS ISREDIT '(DS) = DATASET'

PARSE VAR DS PROJECT'.'GROUP'.'TYPE

'FLMCMD ACCTINFO,'PROJECT',,'GROUP','TYPE','MEMBER

SELECT
  WHEN WORDPOS('COPY ',REGEL) <> 0 THEN /* ALS 'COPY ' VOORKOMT */
    DO
       X = WORDPOS('COPY ',REGEL)
       X = X + 1
       COPYDECK = WORD(REGEL,X)
       CALL ZOOMINCLUDE
    END
  WHEN WORDPOS('INCLUDE ',REGEL) <> 0 THEN
    DO
       X = WORDPOS('INCLUDE ',REGEL) /* ALS 'INCLUDE 'VOORKOMT */
       X = X + 1
       COPYDECK = WORD(REGEL,X)
       CALL ZOOMINCLUDE
    END
  OTHERWISE
       CALL NIETSUCCESVOL /* ALS DE NAAM NIET GEVONDEN KAN WORDEN */
    END
 RETURN

/*! ZOOMINCLUDE *******************************************************
 *                                                                    *
 *   THIS READS ALL LINES IN THE LANGUAGE DEFINITION FOR THE MEMBER   *
 *        BEEING EDITED AND PUTS ALL LINES IN VARIABLE DATA.0         *
 *  AFTER THIS, IT PARSES DATA.0 AND GETS ALL SYSLIBS DATASET NAMES.  *
 *   IT THEN LOOKS FOR THE LANG. DEFINITION MEMBER (ZSALANG) IN THE   *
 *     SYSLIBS FOUND. LAST BUT NOT LEAST IT OPENS THE INCLUDE IN      *
 *                            VIEW-MODE.                              *
 *                                                                    *
 **********************************************************************/

ZOOMINCLUDE:

ZSALANG = '('ZSALANG')' /* I WAS HAVING PROBLEMS WITH QUOTES LOL */

TRAPON=OUTTRAP('ON')

"FREE F (SCLMLD) DS('$A343.PROJDEFS.SOURCE"ZSALANG"'"

"ALLOC F (SCLMLD) SHR DS('$A343.PROJDEFS.SOURCE"ZSALANG"'"

"EXECIO * DISKR SCLMLD (STEM DATA. FINIS" /* LEES MEMBER 'ZSALANG' */

DO ZZ = 1 TO DATA.0    /* DOE NET ZO VAAK ALS ER REGELS ZIJN */

      IF WORD(DATA.ZZ,1) = "FLMSYSLB" THEN DO

      PARSE VAR DATA.ZZ . DSN .

      FULLDSN = "'"DSN"("COPYDECK")'"

      IF SYSDSN(FULLDSN) = "OK" THEN LEAVE

   END  /* IF WORD... */

END  /* ZZ */

IF ZZ >= DATA.0 THEN,

   SAY "SORRY, I COULDN'T FIND" COPYDECK "ANYWHERE."
ELSE,
   CALL SUCCESVOL

/*! SUCCESVOL *********************************************************
 *                                                                    *
 *  SHOW MESSAGE THAT THE COPYDECK WAS FOUND.                         *
 *  NOTHING SPECIAL, JUST PRACTICING.                                 *
 *                                                                    *
 **********************************************************************/

SUCCESVOL:

  SAY COPYDECK 'GEVONDEN!!'
  SAY 'DRUK OP ENTER OM DEZE TE BROWSEN.'
   ADDRESS ISPEXEC "VIEW DATASET("FULLDSN")"
  RETURN

/*! NIETSUCCESVOL *****************************************************
 *                                                                    *
 *  SHOW MESSAGE THAT THE COPYDECK WAS FOUND.                         *
 *  NOTHING SPECIAL, JUST PRACTICING.                                 *
 *                                                                    *
 **********************************************************************/

NIETSUCCESVOL:

    SAY COPYDECK '-NAAM NIET GEVONDEN! CONTROLEER CURSOR POSITIE!!'

What happens now is that If it finds a name next to a INCLUDE string, it takes whatever name is there, even if sometimes it is not an include and says it Cannot find it. But right after that it says it found. And opens it. And does this 2 times.

This is what it shows when nothing found:]

Code:
SORRY, I COULDN'T FIND CA97T010 ANYWHERE.
CA97T010 GEVONDEN!!                      
DRUK OP ENTER OM DEZE TE BROWSEN.
It also browses 2 times the member that doesnt exist.


This is what it shows when include is found:

Code:
DP900004 GEVONDEN!!              
DRUK OP ENTER OM DEZE TE BROWSEN.

It also browses it 4 times!!

I wanted it to stop processing after issuing the

Code:
SAY "SORRY, I COULDN'T FIND" COPYDECK "ANYWHERE."

But it now somehow continues and even goes to the successfull section, and opens in view-mode.

I am lost. And dont even know how it could have functioned well before.

I hope that it's something realy obvious for a trained REXX programmer. I cant figure it out.

This is what happens:

IF it finds a include name that exists, it opens it in view-mode 4 times!!

IF it finds an include name wich doesnt exist, it opens the member that doesnt exist 2 times. Like a little loop.

Can you see why it is doing it 4 times when found. And also issuing succesful and browsing 2 times when not found?

I find a bit of a coinsidence that it finds 4 syslibs and does it four times. But cant figure it out. Might be missing an END or might have a RESULT too much... I dont know.

Thanks for your help so far.

Eduardo
 
Here I am again.

My coments on the top of the MACRO are only a joke of course. I didnt write it by myself, and it is not my property. Just to make that clear.

I think i have too many returns, and have changed it and will try tomorrow.

 
I think you should run this in trace-mode and watch what it does. In particular, when you parse REGEL to obtain the second word, you may be picking up a trailing period; looking for SyslibDSN(member.) will always give you "not found".

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Hi Frank,

I removed some of the call's I was doing, cause I know something was wrong with it, just dont know what exactly. I need more practicing I think.

This is the update I have about it.

There are 4 possibilities in the program:

1 - There is no 'INCLUDE ' or 'COPY ' STRING in the line where the cursor is. (Should issue a message: "COPYDECK NAME NOT FOUND, CONTROL CURSOR POSITION")

2 - There is a string 'INCLUDE ' or 'COPY ' but the word following it is not a copydeck, but is a legal member name. (should issue message "COULDNT FIND COPYDECK ANWHERE")

3 - There is a string 'INCLUDE ' or 'COPY ' but the word following it is not a copydeck, and also not a legal Member-name. (should issue message "COULDNT FIND COPYDECK ANWHERE")

4 - There is a string 'INCLUDE ' or 'COPY ' and the name found is legal and exists. (should open in view-mode)

The program is doing what it should do in 3 of these different situations.

Only when number 2 is the case, it does say "couldnt find it anywhere" But after that it still opens an empty member in view-mode.

When number 3 is the case it issues these messages:

IKJ56709I INVALID DATA SET NAME, 'U01.RFDDDS(SPA-FASE-1)'
IKJ56709I INVALID DATA SET NAME, 'U01.RFDLIB(SPA-FASE-1)'
IKJ56709I INVALID DATA SET NAME, 'A97.HDNCOPY(SPA-FASE-1)'
SORRY, I COULDN'T FIND SPA-FASE-1 ANYWHERE.

And does not open in view mode because the datasets cant be allocated i think.

First thing that I want is the program to stop processing whenever it issues this SAY:

Code:
SAY "SORRY, I COULDN'T FIND" COPYDECK "ANYWHERE."

Is there a way to make it stop when the DATASET NAME is invalid, and not allocate it?

I will put my code again, now i removed some of the call's:

Code:
/*REXX                                                          *
 * SCLM ZOOM EDIT MACRO                                         *
 * FOR                                                          *
 * CORUS  GROUP PLC.                                            *
 * BY                                                           *
 * EDUARDO SERRANO                                              *
 * DECEMBER 2005                                                *
 *                                                              *
 *--------------------------------------------------------------*/

TRACE
  ADDRESS ISREDIT 'MACRO'
  ADDRESS ISREDIT '(ROW,COL) = CURSOR'
  ADDRESS ISREDIT '(REGEL) = LINE' ROW
  ADDRESS ISREDIT '(MEMBER) = MEMBER'
  ADDRESS ISREDIT '(DS) = DATASET'

PARSE VAR DS PROJECT'.'GROUP'.'TYPE

'FLMCMD ACCTINFO,'PROJECT',,'GROUP','TYPE','MEMBER

SELECT
  WHEN WORDPOS('COPY ',REGEL) <> 0 THEN
    DO
       X = WORDPOS('COPY ',REGEL)
       X = X + 1
       COPYDECK = WORD(REGEL,X)
       CALL ZOOMINCLUDE
    END
  WHEN WORDPOS('INCLUDE ',REGEL) <> 0 THEN
    DO
       X = WORDPOS('INCLUDE ',REGEL)
       X = X + 1
       COPYDECK = WORD(REGEL,X)
       CALL ZOOMINCLUDE
    END
  OTHERWISE
       CALL NIETSUCCESVOL
 RETURN

/*! NIETSUCCESVOL *****************************************************
 *                                                                    *
 *  SHOW MESSAGE THAT THE COPYDECK WAS NOT FOUND.                         *
 *  NOTHING SPECIAL, JUST PRACTICING.                                 *
 *                                                                    *
 **********************************************************************/

NIETSUCCESVOL:

    SAY COPYDECK 'NAME NOT FOUND! CHECK CURSOR POSITION!!'
 RETURN

/*! ZOOMINCLUDE *******************************************************
 *                                                                    *
 *   THIS READS ALL LINES IN THE LANGUAGE DEFINITION FOR THE MEMBER   *
 *        BEEING EDITED AND PUTS ALL LINES IN VARIABLE DATA.0         *
 *  AFTER THIS, IT PARSES DATA.0 AND GETS ALL SYSLIBS DATASET NAMES.  *
 *   IT THEN LOOKS FOR THE LANG. DEFINITION MEMBER (ZSALANG) IN THE   *
 *     SYSLIBS FOUND. LAST BUT NOT LEAST IT OPENS THE INCLUDE IN      *
 *                            VIEW-MODE.                              *
 *                                                                    *
 **********************************************************************/

ZOOMINCLUDE:


"ALLOC FI(SCLMLD) SHR REUSE DS('$A343.PROJDEFS.SOURCE"'('ZSALANG')'"'"

"EXECIO * DISKR SCLMLD (STEM DATA. FINIS"

DO ZZ = 1 TO DATA.0


      IF WORD(DATA.ZZ,1) = "FLMSYSLB" THEN DO

      PARSE VAR DATA.ZZ . DSN .

      FULLDSN = "'"DSN"("COPYDECK")'"

      IF SYSDSN(FULLDSN) = "OK" THEN LEAVE

   END  /* IF WORD... */

END  /* ZZ */

IF ZZ >= DATA.0 THEN,

   SAY "SORRY, I COULDN'T FIND" COPYDECK "ANYWHERE."

ELSE,

   SAY "COPYDECK" COPYDECK "GEVONDEN, DRUK OP ENTER OM TE BROWSEN"
   ADDRESS ISPEXEC "VIEW DATASET("FULLDSN")"

I hope someone can help me out yet again.
Any suggestions?
 
Thanks for all the help rexxhead.

I got it to work the way I wanted now, It does everything the way it should do.

Greets,

Eduardo
 
Hi Frank,

I am sorry to bother you again. I am having a new challenge now.

As you said about the trailing periods, you were right about that, at least partialy. Sometimes in the source the includes are finished with a period. Like CS505000. !

Is there an easy way how I could get rid of any periods ( If they exist) before processing continues?

Code:
  WHEN WORDPOS('COPY ',REGEL) <> 0 THEN
    DO
       X = WORDPOS('COPY ',REGEL)
       X = X + 1
       COPYDECK = WORD(REGEL,X)
       CALL ZOOMINCLUDE

I think I should reparse the variable COPYDECK after this part of the program:

Code:
       COPYDECK = WORD(REGEL,X)

And remove any trailing periods. If it exist's on the line.

Another question... Is there a way to get the word exactly above the cursor instead of the full line? I have just seen that sometimes there is an INCLUDE without any statement in front of it, so It doesnt find it. (it only finds a name when there is a 'copy ' or 'include ' in front of the include-name)

Is this all possible or am I wanting too much?

Thanks in advance,

Eduardo
 
Remove trailing dot on a word? Easy:
Code:
word = Strip(word,,".")

All of this is in any REXX book. Do you have one of those? Are you reading it?

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Hi there,

I tried to find some online documentation, but sofar have not been realy succesfull.

Would you recomend a book?

I have found websites where some of the functions are explained. But i guess i will have to start looking for a good book about rexx.

Thank you.

Eduardo
 
Try here: REXX

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top