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

Need to obtein a value form a line using DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
tspr52

New User


Joined: 12 Sep 2006
Posts: 31
Location: Madrid, Spain

PostPosted: Tue Jun 05, 2007 4:08 pm
Reply with quote

Hello at all,

I need to obtain a value from a record, and this could be in any position:

xxxxxpepexxxxxx
xxxpepexxxxxxxx
xxxxxxxpepexxxx

How can i obtain pepe using dfsort?

Thanks in advance, sure this have a easy solution, but i dont found it???

Cheers

Jose Luis
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jun 05, 2007 4:11 pm
Reply with quote

Have you looked at SubString (SS) function

INCLUDE COND=(start,length,SS, EQ,CH,C'whatever')

You will need to check the syntax as this is off the top of my head.
Back to top
View user's profile Send private message
tspr52

New User


Joined: 12 Sep 2006
Posts: 31
Location: Madrid, Spain

PostPosted: Tue Jun 05, 2007 5:43 pm
Reply with quote

Thank you very much, no have any idea icon_eek.gif that substring (SS) could be used with DFSORT. icon_surprised.gif

Thank you very much???? icon_lol.gif

Jose Luis
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Jun 05, 2007 6:41 pm
Reply with quote

tspr52

Did u try "SS" in your code?
did u face any errors?
if so, then show how ur code looks like and wt error u recieved?
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: Tue Jun 05, 2007 8:40 pm
Reply with quote

Jose,

DFSORT's substring function will include (or omit) records that contain a specific string. If that's what you want, then SS will do it.

If that's not what you want, then please explain in more detail what you do want as it's unclear. It sounds like you want to extract "pepe" from each line but if you know what you want to extact you could just hardcode it -> C'pepe', so I'm guessing that's not what you want.

Quote:
no have any idea that substring (SS) could be used with DFSORT


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
tspr52

New User


Joined: 12 Sep 2006
Posts: 31
Location: Madrid, Spain

PostPosted: Tue Jun 05, 2007 8:50 pm
Reply with quote

Thanks to all

I was using funtion substring with rexx or another aplications, but i never thinked will function with dfsort.

I have tried with expat's include and runs ok????

Mine objetive is stopped to develop and used dfsort, because its more easy to improve for string manipulation.

Thank you very much

Jose Luis

*Sorry for my poor english
Back to top
View user's profile Send private message
tspr52

New User


Joined: 12 Sep 2006
Posts: 31
Location: Madrid, Spain

PostPosted: Tue Jun 05, 2007 9:18 pm
Reply with quote

Hello Frank,

Thanks again for your help and good advices.

I dont like to use always rexx for funtions that dfsort could make more quickly and effective.

What i want is to extract all the line that include a string.

Finally mine code is:

SORT FIELDS=COPY
INCLUDE COND=(1,45,SS,EQ,C'BAT1NBAS',OR,
1,45,SS,EQ,C'BAT1SBAS',OR,
1,45,SS,EQ,C'BAT1SB15',OR,
1,45,SS,EQ,C'BAT1SB30',OR,
1,45,SS,EQ,C'BAT1SB60',OR,
1,45,SS,EQ,C'BAT1SB90',OR,
1,45,SS,EQ,C'BAT1CONS')
OUTREC FIELDS=(1:1,45)

This is a part of the file i was reading:

MDDS.BE.BAT1NBAS.WKQIFIT0.O070529
MDDS.BE.BAT1SBAS.BEDQLIS0.T070529
MDDS.BE.BAT1SBAS.BEFCT721.T070529
MDDS.BX2090.BAT1SBAS.BXDC3015.CONTINC3.D070529
MDDS.GP2090.BAT1NBAS.STAT4150.D070604
MDDS.HU.BAT1SBAS.A00EPEDO.D070604
MDDS.HU.BAT1SBAS.S1DQ4500.D070604
MDDS.MC.BAT1WORK.MKDTVNM.BCK.SYSREC
MDDS.PF2090.GDGSSB60.CICPATOE.D070601
MDDS.PF.GDGSSB60.CICPA001.D070603
MDDS.PF.GDGSSB60.CICRA001.G0052V00
MDDS.QA.BAT1HIST.XMLIN.MAESTRO
MDDS.QA.BAT1SB30.QADTPFL.SELECT2


I know how to extract in a fixed position using include, and yes, you are rihgt, everybody must read the getting started before write any posted here icon_redface.gif


Thank you very much for your help and understanding,

Jose Luis
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: Tue Jun 05, 2007 9:31 pm
Reply with quote

Jose,

The job you show will do what you want.

Since you're trying to learn about DFSORT, I'll show you another way to do it using DFSORT's PARSE function. (It's not necessarily a better way to do what you want, just different.)

For this method, from your name of the form x.y.id.otherstuff we extract the 8-byte id and just check it against your list of valid ids.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC PARSE=(%=(ENDAT=C'.'),
               %=(ENDAT=C'.'),
               %01=(ENDBEFR=C'.',FIXLEN=8)),
        BUILD=(1,45,46:%01)
  OUTFIL INCLUDE=(46,8,SS,EQ,
   C'BAT1NBAS,BAT1SBAS,BAT1SB15,BAT1SB30,BAT1SB60,BAT1SB90,BAT1CONS'),
   BUILD=(1,45)
/*
Back to top
View user's profile Send private message
tspr52

New User


Joined: 12 Sep 2006
Posts: 31
Location: Madrid, Spain

PostPosted: Fri Jun 08, 2007 3:56 pm
Reply with quote

Hi Frank

Thanks for your help and advices.

Just one question more:

Can I eliminate the SORTWKS from the JCL?

Is posible execute the sortwks in memory, not in disk?

Its because i have sb37 abends and need to increase the number of SORTWKS and the space need it.

Thanks very much,

Jose Luis
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Jun 08, 2007 4:08 pm
Reply with quote

tspr52

Look at this link to know, how to increase the work space

http://ibmmainframes.com/viewtopic.php?t=21519&highlight=increase
Back to top
View user's profile Send private message
tspr52

New User


Joined: 12 Sep 2006
Posts: 31
Location: Madrid, Spain

PostPosted: Fri Jun 08, 2007 4:21 pm
Reply with quote

Hello Krisprems,

Thanks for your help??? icon_wink.gif and quick answer

well

I need to improve the performance of a JCL, and all i want is to move the sortwks to memory, i think the jcl will run much more quicky....or at least, if the utility calculate the optimun numer of sortwks and space need it, will increase best performance of the job.

Thank you,

Jose Luis
Back to top
View user's profile Send private message
tspr52

New User


Joined: 12 Sep 2006
Posts: 31
Location: Madrid, Spain

PostPosted: Fri Jun 08, 2007 4:25 pm
Reply with quote

I know tha if i dont don't specify JCL SORTWKs, work data sets will be allocated dynamically....but, can i force to do it in memory if dfsort dont have the capacity?
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Jun 08, 2007 4:30 pm
Reply with quote

tspr52
Quote:
can i force to do it in memory if dfsort dont have the capacity?


Am not so sure of this!! icon_sad.gif
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: Sat Jun 09, 2007 8:37 pm
Reply with quote

Quote:
Can I eliminate the SORTWKS from the JCL?


Since for the job shown you are doing a copy, not a sort, you don't need SORTWKs and you SHOULD eliminate them. SORTWKs are only used for a sort, not a copy or merge.

If you're asking in general about SORTWKs for a sort, it is better to NOT specify them so DFSORT can allocate the work data sets dynamically.

Quote:
Is posible execute the sortwks in memory, not in disk?


DFSORT will perform a memory only sort if possible. Increasing the memory available to DFSORT can help it do that up to a point. If DFSORT cannot do a memory only sort, then it will dynamically choose among a memory object sort, hipersorting, data space sorting and SORTWKs to give the optimum sort.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
Search our Forums:

Back to Top