MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Extract data not in fixed position
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
ravikumar_sri2001
Beginner


Joined: 06 Dec 2002
Posts: 117
Topics: 44
Location: Chennai,India

PostPosted: Sat Aug 20, 2011 10:10 pm    Post subject: Extract data not in fixed position Reply with quote

Experts,

I have a list of dataset names in a file. From that list I need to extract dataset names ending with R001,R001,R002 and so on till R999. The length of the dataset names also not fixed.

Thanks in advance for your help!

Thanks,
Ravikumar.
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Sat Aug 20, 2011 10:53 pm    Post subject: Reply with quote

What do you want to do when you have found them?

You can identify them using your sort product, or rexx and probably one of several other utilities (depending on what is available on your system).

Depending on the reason for finding them, one tool or another may be better suited.
_________________
All the best,

di


Last edited by papadi on Sun Aug 21, 2011 3:23 am; edited 1 time in total
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Sat Aug 20, 2011 11:04 pm    Post subject: Reply with quote

You can also use the FINDALL option in SUPERC.
_________________
All the best,

di
Back to top
View user's profile Send private message
ravikumar_sri2001
Beginner


Joined: 06 Dec 2002
Posts: 117
Topics: 44
Location: Chennai,India

PostPosted: Sun Aug 21, 2011 2:21 am    Post subject: Reply with quote

Thanks for your reply! This can be done thru REXX. But can this be done thru SORT ?
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Sun Aug 21, 2011 3:25 am    Post subject: Reply with quote

Did you not read my first reply - yes, it can be done with your sort product (assuming your sort is fairly current).

Suggest you look at superc/findall . . .

And you still did not post how this list is to be used. . .
_________________
All the best,

di


Last edited by papadi on Sun Aug 21, 2011 8:11 am; edited 1 time in total
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Sun Aug 21, 2011 7:27 am    Post subject: Reply with quote

before a sort solution can be provided,
one needs to know what is the record layout of your file.

are the file names delimited by anything? Space?
what are the column positions containing the filename?
a detailed description of you input and output is necessary to provide a solution.

if all you want is a general solution and you do not seem fit to provide any detailed information,
feel free to either look in the dfsort/syncsort/(whatever your sort product is) manuals.
depending on the attributes of the record definition,
PARSE, OMIT, INCLUDE can/could be used.
Also, feel free to look thru the several thousand posts that exist in this forum for a general solution that fits your general needs.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
ravikumar_sri2001
Beginner


Joined: 06 Dec 2002
Posts: 117
Topics: 44
Location: Chennai,India

PostPosted: Sun Aug 21, 2011 9:24 am    Post subject: Reply with quote

Experts,

The LRECL of the input dataset which has file names is 44 bytes.

Sample input:
XXX.XXX.DSN1
XXX.YYY.SDSFD.DSN2
AXX.BXXX.CXXX.R001
AXX.BXXX.CXXX.R002
AXX.BXXX.CXXX.R003
AXX.BXXX.CXXX.R004
AXX.BXXX.CXXX.R005
ASDF.XXXX.CC
SDSD.YYY.VVV
FFFF.GGG.R001
FFFF.GGG.R002
FFFF.GGG.R003
FFFF.GGG.R004
FFFF.GGG.R005
.
.
.
FFFF.GGG.R999



Sample OUTPUT:

AXX.BXXX.CXXX.R001
AXX.BXXX.CXXX.R002
AXX.BXXX.CXXX.R003
AXX.BXXX.CXXX.R004
AXX.BXXX.CXXX.R005
FFFF.GGG.R001
FFFF.GGG.R002
FFFF.GGG.R003
FFFF.GGG.R004
FFFF.GGG.R005
.
..
FFFF.GGG.R999

Thanks,
Ravikumar.
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Sun Aug 21, 2011 11:22 am    Post subject: Reply with quote

Read about INCLUDE or OMIT in your sort documentation. Also look at PARSE and SS (substring).
_________________
All the best,

di


Last edited by papadi on Sun Aug 21, 2011 10:15 pm; edited 2 times in total
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Sun Aug 21, 2011 4:06 pm    Post subject: Reply with quote

keep in mind since the ds record length is only 44,
you will need to SS up to but not including the 44th column with
variations of '.Rnnnb' (where n is numeric and b is space.)
the the 40th thru 44th must be '.Rnnn'
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
ravikumar_sri2001
Beginner


Joined: 06 Dec 2002
Posts: 117
Topics: 44
Location: Chennai,India

PostPosted: Sun Aug 21, 2011 9:52 pm    Post subject: Reply with quote

Experts,

I can give INCLUDE COND=(1,44,SS,EQ,C'R001,R002,R003.....R999') and it will be a lengthy one. Is there any other way ?
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Sun Aug 21, 2011 10:17 pm    Post subject: Reply with quote

If you want to select a series of values (rather than a value within a range) you will need to code all of the individual values. . .
_________________
All the best,

di
Back to top
View user's profile Send private message
Sqlcode
Intermediate


Joined: 15 Dec 2006
Posts: 157
Topics: 38

PostPosted: Mon Aug 22, 2011 8:49 am    Post subject: Reply with quote

ravikumar_sri2001,
See if below helps...
Code:
//STEP0001 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD  *                                                 
XXX.XXX.DSN1                                                     
XXX.YYY.SDSFD.DSN2                                               
AXX.BXXX.CXXX.R001                                               
AXX.BXXX.CXXX.R002                                               
AXX.BXXX.CXXX.R003                                               
AXX.BXXX.CXXX.R004                                               
AXX.BXXX.CXXX.R005                                               
ASDF.XXXX.CC                                                     
SDSD.YYY.VVV                                                     
FFFF.GGG.R001                                                   
FFFF.GGG.R002                                                   
FFFF.GGG.R003                                                   
FFFF.GGG.R004                                                   
FFFF.GGG.R005                                                   
FFFF.GGG.R999                                                   
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                 
 INREC IFTHEN=(WHEN=INIT,OVERLAY=(1,44,SQZ=(SHIFT=RIGHT)))       
 SORT FIELDS=COPY                                               
 OUTFIL INCLUDE=(41,1,CH,EQ,C'R',AND,                           
                (42,3,ZD,GT,000,AND,42,3,ZD,LE,999)),           
        OVERLAY=(1,44,SQZ=(SHIFT=LEFT))                         
/*

OUTPUT
Code:
AXX.BXXX.CXXX.R001
AXX.BXXX.CXXX.R002
AXX.BXXX.CXXX.R003
AXX.BXXX.CXXX.R004
AXX.BXXX.CXXX.R005
FFFF.GGG.R001     
FFFF.GGG.R002     
FFFF.GGG.R003     
FFFF.GGG.R004     
FFFF.GGG.R005     
FFFF.GGG.R999     

Thanks,
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Mon Aug 22, 2011 8:53 am    Post subject: Reply with quote

sqlcode,
clever use of the SQZ function. claps
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
ravikumar_sri2001
Beginner


Joined: 06 Dec 2002
Posts: 117
Topics: 44
Location: Chennai,India

PostPosted: Mon Aug 22, 2011 2:47 pm    Post subject: Reply with quote

SQLCODE,

Excellent solution!!...Thank you so much!!!

Ravikumar.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Aug 22, 2011 2:58 pm    Post subject: Reply with quote

Yes, good solution. But here's a slightly simpler version:

Code:

 OPTION COPY                                     
 INREC OVERLAY=(1,44,SQZ=(SHIFT=RIGHT))           
 OUTFIL INCLUDE=(41,1,CH,EQ,C'R',AND,             
                42,3,FS,EQ,NUM),                 
        OVERLAY=(1,44,SQZ=(SHIFT=LEFT))           


We don't need IFTHEN for INREC, and we can use NUM for the numeric test.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group