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
 

 

Selecting the particular words from the record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Selecting the particular words from the record
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: 3158
Location: Tucson AZ

PostPosted: Wed Mar 25, 2009 10:06 pm    Post subject: Re: Selecting the particular words from the record
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Wed Mar 25, 2009 10:17 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Wed Mar 25, 2009 10:39 pm    Post subject: Re: Selecting the particular words from the record
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Wed Mar 25, 2009 11:03 pm    Post subject:
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 Moderator


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

PostPosted: Wed Mar 25, 2009 11:03 pm    Post subject:
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    Post subject:
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 Moderator


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

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

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

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

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

http://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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Thu Mar 26, 2009 4:27 pm    Post subject:
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    Post subject:
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: 2168
Location: @my desk

PostPosted: Thu Mar 26, 2009 5:28 pm    Post subject:
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: 1238
Location: Richfield, MN, USA

PostPosted: Thu Mar 26, 2009 9:08 pm    Post subject:
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 Moderator


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

PostPosted: Thu Mar 26, 2009 10:12 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm


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