IBM MAINFRAME HELP & SUPPORT FORUMS
Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
 

Extracting all the comments in the member to save as text

THIS IS AN ARCHIVE FORUM: CLICK HERE TO GO TO THE ORIGINAL TOPIC

 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> CLIST & REXX
View previous topic :: View next topic  
Author Message
pandu



Joined: 08 Dec 2005
Posts: 7
Location: pune

Posted: Thu Dec 08, 2005 1:19 pm    Post subject: Extracting all the comments in the member to save as text  

Hi All

could any one help me to do following task using CLIST or REXX,

"Extracting all the comments in the member and putting those comments in a new .txt file. "

cheers
pandu
Back to top  
superk



Joined: 26 Apr 2004
Posts: 3304
Location: Charlotte,NC USA

Posted: Thu Dec 08, 2005 5:41 pm    Post subject: Re: Extracting all the comments in the member to save as tex  

And these comments would be identified how?
Back to top  
pandu



Joined: 08 Dec 2005
Posts: 7
Location: pune

Posted: Fri Dec 09, 2005 11:14 am    Post subject:  

hi superk,

thanks for u r interest to see this.

In COBOL member 7th column contains * it is comment na. i want to Extract these lines.


regards
pandu
Back to top  
superk



Joined: 26 Apr 2004
Posts: 3304
Location: Charlotte,NC USA

Posted: Thu Dec 15, 2005 6:58 pm    Post subject: Re: Extracting all the comments in the member to save as tex  

To me, this would make more sense to do as an ISPF EDIT Macro. The following is a simple macro, written in REXX, that will do what you need.
Code:
/* REXX GETCOMM */                                         
"ISREDIT MACRO"                                           
"ISREDIT (currdsn) = DATASET"                             
"ISREDIT (currmem) = MEMBER"                               
"ISREDIT (last) = LINENUM .ZLAST"                         
x = LISTDSI("'"currdsn"'")                                 
If rc = 0 Then                                             
  Do                                                       
    recfm = Substr(SYSRECFM,1,1)||" "||,                   
      Substr(SYSRECFM,2,1)||" "||,                         
      Substr(SYSRECFM,3,1)||" "||,                         
      Substr(SYSRECFM,4,1)||" "||,                         
      Substr(SYSRECFM,5,1)||" "||,                         
      Substr(SYSRECFM,6,1)                                 
    recfm = Strip(recfm)                                   
    lrecl = SYSLRECL                                       
    blk   = SYSBLKSIZE                                     
  End                                                     
Do n = 1 To last                                           
  "ISREDIT (data) = LINE "n                               
  If Substr(data,7,1) = "*" Then Queue data               
End                                                     
Queue ""                                               
"ISREDIT RESET"                                         
ddname = "#"Time(S)                                     
dsname = currmem".TXT"                                 
"ALLOC DD("ddname") DA("dsname") MOD REU DELETE"       
"FREE DD("ddname")"                                     
"ALLOC DD("ddname") DA("dsname") NEW REU CATALOG       
  RECFM("recfm") LRECL("lrecl") BLKSIZE("blk")"         
"EXECIO * DISKW "ddname" (FINIS"                       
"ISPEXEC EDIT DATASET("dsname")"                       
"FREE DD("ddname")"                                     
Exit 0                                                 
Back to top  
 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> CLIST & REXX
Page 1 of 1
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM