View previous topic :: View next topic
|
Author |
Message |
diwa_thilak
Active User
Joined: 13 Jul 2006 Posts: 205 Location: At my desk
|
|
|
|
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 |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
diwa_thilak
Active User
Joined: 13 Jul 2006 Posts: 205 Location: At my desk
|
|
|
|
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 |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Other option:
- Use 3.15 (Extended Search-For Utility) instead of 3.14 (Search-For Utility)
- In "Process Options" field add: LMTO NOPRTCC NOSUMS
- Other parameters are same as in 3.14
- Run your search.
- Voila! (almost perfect from the beginning...)
|
|
Back to top |
|
|
diwa_thilak
Active User
Joined: 13 Jul 2006 Posts: 205 Location: At my desk
|
|
|
|
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 |
|
|
|