IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

COPYCOLS Usage


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Mon Jul 20, 2009 10:01 pm
Reply with quote

Folks,

I have submitted a search request in mainframes for a keyword "vendor" in mainframes using the option 3.14 and saved the result in a PS dataset.

I used the below commands to identify the impacted components list alone.

f all 'String(s) found';

Quote:
000060 AC0101 --------- STRING(S) FOUND ----------------
- - - - - - - - - - - - - - - - - - - 10 Line(s) not Displayed
000071 AC0111 --------- STRING(S) FOUND ----------------
- - - - - - - - - - - - - - - - - - - 10 Line(s) not Displayed
000082 AC201 --------- STRING(S) FOUND ----------------
- - - - - - - - - - - - - - - - - - - 16 Line(s) not Displayed
000099 AC234 --------- STRING(S) FOUND ----------------


now my task is to extract only the program names starting from column 3 till 11 into a new dataset.

Is there any way i can extract only column from 3 to 11. I tried COPYCOLS, but i am getting an error message like "COPYCOLS not found".

Let me know your views to approach this issue.
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Mon Jul 20, 2009 10:15 pm
Reply with quote

I have a REXX Edit Macro COPYCOL to copy columns to other columns but I am not sure that exactly fits your current need but could be a starting point for you.
Code:
/* REXX EDITOR MACRO COPYCOL BY DOUGLAS WILDER  */
/* COPYCOL FROMCOL LEN TOCOL                    */
 
ADDRESS "ISREDIT" "MACRO (COLMN,LN, COLMN2) NOPROCESS"
ADDRESS "ISREDIT" "PROCESS DEST RANGE C M"
 
ADDRESS "ISREDIT" "ISREDIT" "(CMD)   = RANGE_CMD"       
ADDRESS "ISREDIT" "ISREDIT" "(FIRST) = LINENUM .ZFRANGE"
ADDRESS "ISREDIT" "ISREDIT" "(LAST)  = LINENUM .ZLRANGE"
 
IF COLMN2 = "" THEN DO
    SAY "MISSING PARAMETERS"
    SAY "COPYCOL FROMCOL LENGTH TOCOL"
    SAY "USE CC CC AROUND LINES TO BE COPIED"
    EXIT
END 

DO CURRLN = FIRST TO LAST
   ADDRESS "ISREDIT" "(DATALN) = LINE (CURRLN)"
   DATA1 = SUBSTR(DATALN,1,COLMN2 - 1)
   DATA2 = SUBSTR(DATALN,COLMN, LN)
   DATA3 = SUBSTR(DATALN, COLMN2 + LN)
   DATALN = DATA1 || DATA2 || DATA3
   ADDRESS "ISREDIT" "LINE (CURRLN) = (DATALN)"
END
 
EXIT
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Jul 20, 2009 10:50 pm
Reply with quote

You could also:

- Allocate an 8-byte dataset. Copt that dataset into it (the data will be truncated) and them move that dataset into your target location.

- Setup a quick call to SORT with an OUTREC FIELDS=(1:3,8,n:X) to extract just the column and to properly pad to the output dataset LRECL.
Back to top
View user's profile Send private message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Mon Jul 20, 2009 11:13 pm
Reply with quote

Hi Kevin,

The output dataset is the result of a search function (using 3.14), hence using the sort utility it makes the process complex.

Thanks Wilder, the rexx utility was really usefull, it copies to the same dataset, i will try to move the data into a seperate dataset.

Is there any ISPF utility which can cut only the specific column from the dataset.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Jul 21, 2009 5:43 am
Reply with quote

You can use the following in the cmd line:
Code:
c all nx 12 80 p'=' ' ';c all nx 1 2 p'=' ' '


I may be wrong, but I suspect that cols 1 & 2 are blanks. If so, just use the 1st change cmd.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Tue Jul 21, 2009 7:13 am
Reply with quote

I think you should do this (incorporating the other suggestions):
Code:
ex all
f all 'String(s) found';
del all x
c all nx 12 80 p'=' ' ';
c all nx 1 2 p'=' ' '
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Jul 21, 2009 8:03 pm
Reply with quote

Other option:

  1. Use 3.15 (Extended Search-For Utility) instead of 3.14 (Search-For Utility)
  2. In "Process Options" field add: LMTO NOPRTCC NOSUMS
  3. Other parameters are same as in 3.14
  4. Run your search.
  5. Voila! (almost perfect from the beginning...)
Back to top
View user's profile Send private message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Tue Jul 21, 2009 8:37 pm
Reply with quote

Thanks a lot Folks.

You are not wrong Jack (You are always right) it worked.

Thanks Pedro.

It was nice to learn a new command in 3.15 option Marso. Thanks
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts STEM usage in REXX CLIST & REXX 14
No new posts z/OS Modules Usage report using SMF 42 DFSORT/ICETOOL 2
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts JCL and TAPE drives: how to maximize ... JCL & VSAM 9
No new posts Usage of BINSEARCH PL/I PL/I & Assembler 1
Search our Forums:

Back to Top