View previous topic :: View next topic
|
Author |
Message |
Nandananilchintala
New User
Joined: 25 Mar 2009 Posts: 19 Location: Hyderabad
|
|
|
|
Hi,
I have coded the follwoing macro, to view a member from SCLM, The member name is retrieved from the cursor position. i.e. it reads the 8 characters at the present cursor position, and those characters would be the name of some other module. that module must be opened in view mode. I have used the LMLIST for this purpose. I will scan all the members from all the levels of SLCM one after the other.
but when it is not retrieving all the members from each of SCLM levels.
Instead, it is scanning(or retrieving) only some members from the SCLM.
As a result im am unable to open the required member in view mode(as it is not being retrieved)
Please let me know why im facing this problem and how can i make the following command to retrieve all the members.
Code: |
"ISREDIT (DATA) = LINE" .ZCSR
MEMBER1 = SUBSTR(DATA,COL,8)
LEN1 = LENGTH(MEMBER1)
MEMBER2 = STRIP(MEMBER1)
TEMP1 = SUBSTR(MEMBER2,8,1)
IF (TEMP1 = '(' | TEMP1 = ')')
THEN DO
FLAG = 'YES'
TEMP2 = SUBSTR(MEMBER1,1,7)
MEMBER1 = TEMP2||' '
END
VARFIN = 'FOUND'
/* OPENING OF THE MODULE STARTS */
DDN = 'RCBR033.IN16608.PLINCL'
ADDRESS ISPEXEC "LMINIT DATAID(DSET) DATASET('"DDN"')"
ADDRESS ISPEXEC "LMOPEN DATAID("DSET")"
DO WHILE (RC = 0 & VARFIN = 'FOUND')
ADDRESS ISPEXEC "LMMLIST DATAID("DSET") OPTION(LIST)",
"MEMBER(MEMBER) STATS(YES)"
IF RC = 0 THEN DO
IF MEMBER = MEMBER1 THEN DO
VARFIN = 'HI'
IF FLAG = 'YES' THEN
ADDRESS ISPEXEC "VIEW DATASET('"DDN"("TEMP2")')"
ELSE
ADDRESS ISPEXEC "VIEW DATASET('"DDN"("MEMBER2")')"
END
END
ELSE
DO
/* ADDRESS ISPEXEC "LMCLOSE DATAID("DSET")" */
SELECT
WHEN(DDN = 'RCBR033.IN16608.PLINCL') THEN
DDN = 'RCBR033.DEVELOP.PLINCL'
WHEN(DDN = 'RCBR033.DEVELOP.PLINCL') THEN
DDN = 'RCBR033.SYSTEM.PLINCL'
WHEN(DDN = 'RCBR033.SYSTEM.PLINCL') THEN
DDN = 'RCBR033.SHIPPED.PLINCL'
WHEN(DDN = 'RCBR033.SHIPPED.PLINCL') THEN DO
ADDRESS ISPEXEC "LMCLOSE DATAID("DSET")"
LEAVE
END
END /* SELECT */
ADDRESS ISPEXEC "LMINIT DATAID(DSET) DATASET('"DDN"')"
ADDRESS ISPEXEC "LMOPEN DATAID("DSET")"
END
END /* DO WHILE */
|
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Is the member name always 8 bytes long or can it be shorter |
|
Back to top |
|
|
Nandananilchintala
New User
Joined: 25 Mar 2009 Posts: 19 Location: Hyderabad
|
|
|
|
It can be shorter, it may be of either 7 or 8 characters,
I observed that LMMLIST retrieves the members assuming it as 8 chars( my understanding)
i.e, if a member name is actually 'ABCXXXX', then LMMLIST retrieves it as 'ABCXXXX ' . I have coded my Macro assuming this...
if the member name i read from cursor position is of 7 chars , then i appended a blank at the end of it, before comparing .....
is my logic wrong?
do i have to use only the member name(without using the blank at the end) |
|
Back to top |
|
|
|