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

Selecting the particular words from the record


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Wed Mar 25, 2009 10:01 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Mar 25, 2009 10:06 pm
Reply with quote

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
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Wed Mar 25, 2009 10:09 pm
Reply with quote

Thanks William,
Any suggestion to solve the issue?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Mar 25, 2009 10:17 pm
Reply with quote

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
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Wed Mar 25, 2009 10:25 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Mar 25, 2009 10:39 pm
Reply with quote

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
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Wed Mar 25, 2009 10:47 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Mar 25, 2009 11:03 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Mar 25, 2009 11:03 pm
Reply with quote

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
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Wed Mar 25, 2009 11:09 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Mar 25, 2009 11:21 pm
Reply with quote

For an overview of DFSORT's PARSE function, see:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG30/2.5?DT=20080529102039

For complete details on DFSORT's PARSE function, see:

www.ibm.com/systems/support/storage/software/sort/mvs/peug/

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Wed Mar 25, 2009 11:23 pm
Reply with quote

Thank you Frank appreciated!!!
Back to top
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Thu Mar 26, 2009 4:23 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Mar 26, 2009 4:27 pm
Reply with quote

Once again, you are using SyncSort and solution is for DFSort . . .
Back to top
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Thu Mar 26, 2009 4:36 pm
Reply with quote

So STARTAT is also DFSORT syntax? if yes then i did successfull ran the above jcl provided by Frank.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Mar 26, 2009 5:28 pm
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Thu Mar 26, 2009 9:08 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Mar 26, 2009 10:12 pm
Reply with quote

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
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Fri Mar 27, 2009 11:03 am
Reply with quote

Thanks Everybody.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top