Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

COPYCOLS Usage

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: COPYCOLS Usage
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    Post subject:
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

Moderator Team Head


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

PostPosted: Mon Jul 20, 2009 10:50 pm    Post subject: Reply to: COPYCOLS Usage
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    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Tue Jul 21, 2009 7:13 am    Post subject: Reply to: COPYCOLS Usage
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: 1232
Location: Israel

PostPosted: Tue Jul 21, 2009 8:03 pm    Post subject: Reply to: COPYCOLS Usage
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts )SEL and )ENDSEL usage cvnlynn TSO/ISPF 4 Thu Jun 15, 2017 1:15 am
No new posts Need inputs on Space requirement and... ashek15 IMS DB/DC 0 Sat Apr 01, 2017 8:26 am
No new posts How can amount of the Storage Usage b... esduman61 CICS 6 Wed Mar 09, 2016 1:19 pm
No new posts Controlling usage of resources by tasks raja1128 CICS 3 Fri Nov 06, 2015 9:53 am
No new posts TDQ & its usage as ATI akodakka CICS 3 Sat Oct 17, 2015 6:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us