View previous topic :: View next topic
|
Author |
Message |
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Hi All,
This is the data i have got:-
====================================
ABCD AGCBBBBBBB
ABCD &CMSFN..ABLO.S1.&CMSKE..I
AB &CMSFN..ABLO.S1.&CMSKE..DATA
------- &CMSFN..ABLO.S1.&CMSKE..I
ABCD DD DSN= &CMSFN..ABLO.S1.&CMSKE..I
&CMSFN..ABLO.S1.&CMSKE..INDEX
----------- STRING(S) FOUND -------------------
BCD ( NAME(&CMSFN..AMAX.S1.&CMSIAM..I)
=====================================
Now the requirement is as follows;
1.Need to extract only the files which start with &CMSFN, this file can be of any character.
2. Dont want to extract the entire row.
3.This name can start anywhere in the PDS.
Response would be really appreciated. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Code: |
====================================
ABCD AGCBBBBBBB
ABCD &CMSFN..ABLO.S1.&CMSKE..I
AB &CMSFN..ABLO.S1.&CMSKE..DATA
------- &CMSFN..ABLO.S1.&CMSKE..I
ABCD DD DSN= &CMSFN..ABLO.S1.&CMSKE..I
&CMSFN..ABLO.S1.&CMSKE..INDEX
----------- STRING(S) FOUND -------------------
BCD ( NAME(&CMSFN..AMAX.S1.&CMSIAM..I)
===================================== |
Even "coded" your example looks like crap.
Highlight/cut/paste and then highlight/click Code, then preview. Do not attempt to justify in the posting box, notepad (with a fixed font) will work well. |
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Thanks William,
Any suggestion to solve the issue? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
himanshu7 wrote: |
Any suggestion to solve the issue? |
Not until you manage to post a reasonable image of what your input looks like...... |
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Code: |
1 ISRSUPC - MVS/PDF FILE/LINE/WORD/BYTE/SFOR COMPARE UTILITY- ISPF FOR z/OS
2009/03/25 20.39 PAGE 1
LINE-# SOURCE SECTION SRCH DSN: DGCVPG2.V831.PROCLIB
ABLOCOA1 CONCAT#(1) ----------- STRING(S) FOUND -------------------
2 &CMSFN..ABLO.SA.&CMSKE -
5 &CMSFN..ABLO.SA.&CMSKE..D -
8 &CMSFN..ABLO.SA.&CMSKE..I -
ABLOCOA2 CONCAT#(1) ----------- STRING(S) FOUND -------------------
2 &CMSFN..ABLO.SA.&CMSKE -
5 &CMSFN..ABLO.SA.&CMSKE..D -
8 &CMSFN..ABLO.SA.&CMSKE..I -
ABLOCO11 CONCAT#(1) ----------- STRING(S) FOUND -------------------
2 &CMSFN..ABLO.S1.&CMSKE -
5 &CMSFN..ABLO.S1.&CMSKE..D -
8 &CMSFN..ABLO.S1.&CMSKE..I -
ABLOCO12 CONCAT#(1) ----------- STRING(S) FOUND -------------------
2 &CMSFN..ABLO.S1.&CMSKE -
5 &CMSFN..ABLO.S1.&CMSKE..D -
8 &CMSFN..ABLO.S1.&CMSKE..I -
ABLOCO21 CONCAT#(1) ----------- STRING(S) FOUND -------------------
2 &CMSFN..ABLO.S2.&CMSKE -
5 &CMSFN..ABLO.S2.&CMSKE..D -
8 &CMSFN..ABLO.S2.&CMSKE..I -
ABLOCO22 CONCAT#(1) ----------- STRING(S) FOUND -------------------
2 &CMSFN..ABLO.S2.&CMSKE -
5 &CMSFN..ABLO.S2.&CMSKE..D -
8 &CMSFN..ABLO.S2.&CMSKE..I -
ABLOCO31 CONCAT#(1) ----------- STRING(S) FOUND -------------------
2 &CMSFN..ABLO.S3.&CMSKE -
5 &CMSFN..ABLO.S3.&CMSKE..D -
8 &CMSFN..ABLO.S3.&CMSKE..I -
ABLOCO32 CONCAT#(1) ----------- STRING(S) FOUND -------------------
2 &CMSFN..ABLO.S3.&CMSKE -
5 &CMSFN..ABLO.S3.&CMSKE..D -
8 &CMSFN..ABLO.S3.&CMSKE..I - |
|
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Much better, but only the one screen is needed.....
himanshu7 wrote: |
Now the requirement is as follows;
1.Need to extract only the files which start with &CMSFN, this file can be of any character.
2. Dont want to extract the entire row.
3.This name can start anywhere in the PDS. |
Now, what does "this file can be of any character" mean?
Do you mean PDS member when you wrote "name can start anywhere in the PDS"? |
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Quote: |
Now, what does "this file can be of any character" mean? |
The Name of the file can be of any lenght i.e 25 to 30 charac.
Quote: |
Do you mean PDS member when you wrote "name can start anywhere in the PDS"? |
I mean the name &CMSFN can start anywhere in the row.It is not fixed.
i just want to extract files name from the entire row which start with &CMSFN name at the begening and can be of any character. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
himanshu7 wrote: |
I mean the name &CMSFN can start anywhere in the row.It is not fixed. |
Actually, if you are using the above ISRSUPC output, they all should be starting at the same place in the record...... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Rajveer,
Assuming you want to extract just the file name for each record that has &CMSFN somewhere in the record, you can use a DFSORT job like the following:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,80,SS,EQ,C'&CMSFN')
INREC PARSE=(%01=(STARTAT=C'&CMSFN',FIXLEN=44)),
BUILD=(%01)
/*
|
For your input example, SORTOUT would have:
Code: |
&CMSFN..ABLO.SA.&CMSKE
&CMSFN..ABLO.SA.&CMSKE..D
&CMSFN..ABLO.SA.&CMSKE..I
&CMSFN..ABLO.SA.&CMSKE
&CMSFN..ABLO.SA.&CMSKE..D
&CMSFN..ABLO.SA.&CMSKE..I
...
|
If that's not what you want, then you need to explain more clearly what you do want. |
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Code: |
INCLUDE COND=(1,80,SS,EQ,C'&CMSFN')
INREC PARSE=(%01=(STARTAT=C'&CMSFN',FIXLEN=44)),
BUILD=(%01)
|
Could you explain "INREC PARSE=(%01=(" and
Let me try and will keep you updated on the result.
Thank you Frank !! |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Thank you Frank appreciated!!! |
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Hi,
Frank the code worked fine but not as i wanted.
The length of the file name is variable so fixlen is fetching unwanted variables as well.
So i tried using END AT
I tried using ENDAT but got the below error.
JCL
Code: |
//STEP002 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=DGCVPG2.V831.LISTDSN.FILTER,DISP=SHR
//SORTOUT DD DSN=DGCVPG2.V831.LISTDSN.FILTER2,DISP=SHR
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,80,SS,EQ,C'DGCVPG2')
INREC PARSE=(%01=(ENDAT=C'''))
Spool Output---->
********************************* TOP OF DATA
SYNCSORT FOR Z/OS 1.3.1.0N U.S. PATENTS: 4210961, 5117495 (C) 2007
SYNCS
z/OS 1.9.0
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 366B1, MODEL 2097 604
LICE
SYSIN :
OPTION COPY
INCLUDE COND=(1,80,SS,EQ,C'DGCVPG2')
INREC PARSE=(%01=(ENDAT=C'''))
*
WER268A INREC STATEMENT : SYNTAX ERROR
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE |
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Once again, you are using SyncSort and solution is for DFSort . . . |
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
So STARTAT is also DFSORT syntax? if yes then i did successfull ran the above jcl provided by Frank. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
himanshu7,
The PARSE function is supported by your SyncSort version . I think you missed one quote(') in the ENDAT.
Code: |
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,80,SS,EQ,C'DGCVPG2')
INREC PARSE=(%01=(ENDAT=C'''')) |
|
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Sometimes the DFSORT and Syncsort syntax is the same, sometimes it ain't. Suggest you refer to the manuals for the product installed at your site. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
himanshu7,
Quote: |
Frank the code worked fine but not as i wanted.
The length of the file name is variable so fixlen is fetching unwanted variables as well. |
I don't understand how your ENDAT=C'''' relates to the question you asked and the example you showed. The names don't have an apostrophe at the end in your example. I gave you a DFSORT job that worked based on the example you showed. If you had shown a different example, I would have given you a DFSORT job that worked for that example.
Quote: |
So STARTAT is also DFSORT syntax? |
PARSE has been available with DFSORT since I first "invented" it in April, 2006.
Please in the future:
1) Don't post in the DFSORT Forum if you're not using DFSORT.
2) Post examples and explanations that match what you're actually trying to do.
This will save everyone time (including you). |
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Thanks Everybody. |
|
Back to top |
|
|
|