MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to Extract commented lines from a PDS?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
gotluru
Beginner


Joined: 17 Dec 2002
Posts: 29
Topics: 6

PostPosted: Mon Feb 10, 2003 2:55 pm    Post subject: How to Extract commented lines from a PDS? Reply with quote

Hi,

I am creating documentatio for a application. I am intersted to get all the commented lines from programs into one file.

How can I achieve this task?

Thanks In Advance,
Prasad
Back to top
View user's profile Send private message
CaptBill
Beginner


Joined: 02 Dec 2002
Posts: 100
Topics: 2
Location: Pasadena, California, USA

PostPosted: Mon Feb 10, 2003 3:30 pm    Post subject: Reply with quote

Wouldn't you scan the PDS member and extract those records with the comment character in the proper position of the record?

I'll leave the ISPF function or writing the code for this task to you since you did not specify if you planned to use a function of ISPF or a program and the language.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
gotluru
Beginner


Joined: 17 Dec 2002
Posts: 29
Topics: 6

PostPosted: Mon Feb 10, 2003 3:54 pm    Post subject: Reply with quote

Hi Bill,

Thanks for the information.

Can you give me the syntax.. I am looking for '*' at 7th column

I am using
SRCHFOR '*' 7

I am getting the error
SRCHFOR '*' 7
ISRS024W EXTRA DATA DETECTED AFTER NORMAL STATEMENT END. STATEMENT ACCEPTED WITH WARNING NOTIFICATION.

Thanks,
Prasad
Back to top
View user's profile Send private message
gotluru
Beginner


Joined: 17 Dec 2002
Posts: 29
Topics: 6

PostPosted: Mon Feb 10, 2003 5:12 pm    Post subject: Reply with quote

Hi Bill,

I got it.. I used CMPCOLM 7.
Thanks for your help..

Prasad

Now I have one more issue, I need comment lines before Procedure Divison. How I can achieve this?
Back to top
View user's profile Send private message
CaptBill
Beginner


Joined: 02 Dec 2002
Posts: 100
Topics: 2
Location: Pasadena, California, USA

PostPosted: Mon Feb 10, 2003 6:57 pm    Post subject: Reply with quote

You did not say what you were using to do the scans. It is not an ISPF Edit command I am familiar with. It may be a home grown edit macro.

Please advise.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Feb 10, 2003 7:03 pm    Post subject: Reply with quote

gotluru,

If you are planning to get the comment lines for each indivdual program then it is very easy to find the comment lines before the procedure division.you can run a simple sort which will give you all the comment lines before the procedure division.

But if you are planning to get all the comments from a pds which has many cobol programs then you need to flatten the pds to a sequential file using IEBPTCH and run it thru rexx or clist to get the desired lines.

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Tue Feb 11, 2003 1:36 am    Post subject: Reply with quote

Kolusu,
This is a job i have coded to extract comments from a program, in 2 passes..Are there any other simpler methods in ICETOOL,so that we can have it done in a single pass.

Code:

//STEP1    EXEC PGM=ICETOOL                                           
//IN1      DD DISP=SHR,DSN=INPUT.FILE
//MATCH    DD SYSOUT=*                                                 
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//TOOLIN   DD *                                                       
  COPY FROM(IN1) USING(CTL1)                                           
  COPY FROM(IN1) USING(CTL2)                                           
/*                                                                     
//CTL1CNTL DD *                                                       
   INREC FIELDS=(1,80,SEQNUM,4,ZD)                                     
   OUTFIL FNAMES=CTL2CNTL,                                             
   INCLUDE=(8,9,CH,EQ,C'PROCEDURE'),                                   
   OUTREC=(X,C'OUTFIL FNAMES=MATCH,ENDREC=',81,4,C',',80:X)           
/*                                                                     
//CTL2CNTL DD DSN=&&TN,DISP=(,PASS),UNIT=SYSDA,SPACE=(TRK,(1,1),RLSE) 
//         DD *               
    INCLUDE=(7,1,CH,EQ,C'*')     
/*                               
//                               



coolman
________
starcraft II replays


Last edited by coolman on Sat Feb 05, 2011 1:17 am; edited 1 time in total
Back to top
View user's profile Send private message
gotluru
Beginner


Joined: 17 Dec 2002
Posts: 29
Topics: 6

PostPosted: Tue Feb 11, 2003 9:58 am    Post subject: Reply with quote

Hi Ravi,

Thanks for your help..

FileAid is copying all the records(comment lines) which satisfying the above conditions. I need only comment lines before the procedure division. Do we have any option in fileaid to stop copying records if it found 'PROCEDURE DIVISION'.

Thanks,
Prasad
Back to top
View user's profile Send private message
gotluru
Beginner


Joined: 17 Dec 2002
Posts: 29
Topics: 6

PostPosted: Tue Feb 11, 2003 10:04 am    Post subject: Reply with quote

Hi Kolusu,

Thanks for your response.

I can flatten into one member, do you have any rexx to get the desired output? Like Deleting the lines between 'PROCEDURE DIVISION' and next program start 'IDENTIFICATION DIVISION'

Hi Coolman,

Thanks for your ICETOOL Solution.
We don't have icetool in our shop


Thanks,
Prasad
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Feb 11, 2003 9:48 pm    Post subject: Reply with quote

gotluru,

I am not an expert in rexx but I can provide a sort solution. In fact cool man's solution will also work with syncsort just by changing the pgm name SYNCTOOL.

I will post the complete solution to get the comment lines from a pds with all members soon

Thanks

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Feb 11, 2003 11:10 pm    Post subject: Reply with quote

gotluru,

The following Jcl will give you the desired results. A brief description of the job.Let us say that you have a cobol program name COBPGM1. you want to find out the comment lines before procedure division.

Using file-aid we create 2 files.

Code:

$$DD01 SPACE STOP=(8,EQ,C'PROCEDURE')
$$DD01 COPY IF=(7,EQ,C'*')   


The above 2 control cards will copy all the comment lines after the procedure division to the file DD01O


Code:

$$DD02 COPY IF=(7,EQ,C'*')   


This will copy all the comment lines in the program to the file DD02O.

now we take these 2 files and concatenate as one single file and run it thru sort eliminating the duplicates.

Now the output file will only have the comment lines before the procedure division.


Code:

//STEP0100 EXEC PGM=FILEAID                                 
//*                                                         
//SYSUDUMP DD  SYSOUT=*                                     
//SYSPRINT DD  SYSOUT=*                                     
//SYSLIST  DD  SYSOUT=*                                     
//SYSTOTAL DD  SYSOUT=*                                     
//DD01     DD  DSN=YOUR.PDS(COBPGM1),           
//             DISP=SHR                                     
//DD02     DD  DSN=YOUR.PDS(COBPGM1),           
//             DISP=SHR                                     
//DD01O    DD  DSN=&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE), 
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)             
//DD02O    DD  DSN=&T2,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE), 
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)             
$$DD01 SPACE STOP=(8,EQ,C'PROCEDURE')
$$DD01 COPY IF=(7,EQ,C'*')           
$$DD02 COPY IF=(7,EQ,C'*')           
//*                                 
//STEP0200 EXEC PGM=SYNCTOOL                 
//*                                         
//TOOLMSG  DD  SYSOUT=*                     
//DFSMSG   DD  SYSOUT=*                     
//IN       DD  DSN=&T1,DISP=OLD
//         DD  DSN=&T2,DISP=OLD
//OUT      DD  DSN=YOUR COMMENT FILE BEFORE PROCEDURE DIVISION,         
//             DISP=(NEW,CATLG,DELETE),     
//             UNIT=SYSDA,                   
//             SPACE=(CYL,(1,1),RLSE)       
//TOOLIN   DD  *                             
  SELECT FROM(IN) TO(OUT) ON(1,80,CH) NODUPS
/*                                           


Ps: This may not be an optimal solution but it will give you the desired results.

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Wed Feb 12, 2003 2:40 am    Post subject: Reply with quote

Kolusu,
Your solution would work for only a single member of a PDS. Hence, for every member of the PDS, I should be changing the member name (COBPGM1 in this case) . How do we do it for all the members of the PDS in a single shot using ICETOOL/SYNCTOOL.

Cheers,
Coolman.

Gotluru, I would be posting a REXX solution soon to your question.
________
buy silver surfer


Last edited by coolman on Sat Feb 05, 2011 1:17 am; edited 1 time in total
Back to top
View user's profile Send private message
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Wed Feb 12, 2003 3:30 am    Post subject: Reply with quote

Gotluru,
The following REXX code should work. I havent tested it as Iam away from my M/F link ... So plz test it and use it...

Code:

/* Rexx - Spn */

/* COMMENT-EXTRACTION SOURCE */

"ALLOC DA('YOUR.OUTPUT.FILE') DD(OUTPUT) SHR"
/* Initialization */
out. = ""
i    = 0
total = i

Say "Enter your PDS Name : "
Pull Pds_Name
x = outtrap('a.')
"LISTDS '"Pds_Name"' MEMBERS"
x = outtrap('OFF')
total = a.0 - 6
Do ctr = 7 to total
   Say 'Processing member ' ctr - 6 ' of ' total
   Full_Name = "'"Pds_Name"("strip(a.ctr)")'"
   "ALLOC DA("Full_Name") DD(INPUT) SHR ENQ"
   "EXECIO * DISKR INPUT( Stem In. Finis "
   "FREE F(INPUT)"
    i = i + 1
    out.i = "MEMBER " a.ctr
    Do lines = 1 to In.0
       Pos1 =   Pos('Procedure',In.lines)
       Pos2 =   Pos('*',In.lines)
       If Pos1 >= 8 & Pos1 <= 12 & Pos2 = 0  then leave
       else
           Do
               If Pos2 = 7 then
                 Do
                     i = i + 1
                    out.i = In.lines
                  End
            End
      End
 i = i + 1
 out.i = "------------------------"
 Drop In.
End
"EXECIO * DISKW OUTPUT( Stem out. Finis "     
"FREE F(OUTPUT)"


Hope this helps you Gotluru.

Cheers,
Coolman
________
easy vape


Last edited by coolman on Sat Feb 05, 2011 1:17 am; edited 1 time in total
Back to top
View user's profile Send private message
gotluru
Beginner


Joined: 17 Dec 2002
Posts: 29
Topics: 6

PostPosted: Wed Feb 12, 2003 3:10 pm    Post subject: Reply with quote

Hi All,

I am able to get comment lines from my program using coolman solution.

Thanks to Everybody..

Kolusu,
I am not able to use your solution, one of the reasons is we dont have synctool at out shop.

Coolman,

Special Thanks to you. Your rexx program works cool.

Thanks,
Prasad
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group