Joined: 02 Dec 2002 Posts: 100 Topics: 2 Location: Pasadena, California, USA
Posted: Mon Feb 10, 2003 3:30 pm Post subject:
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.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Mon Feb 10, 2003 7:03 pm Post subject:
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.
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
Posted: Tue Feb 11, 2003 1:36 am Post subject:
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.
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'.
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
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Tue Feb 11, 2003 9:48 pm Post subject:
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
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Tue Feb 11, 2003 11:10 pm Post subject:
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.
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
Posted: Wed Feb 12, 2003 2:40 am Post subject:
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
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
Posted: Wed Feb 12, 2003 3:30 am Post subject:
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)"
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