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 

Select generic string in a VB file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
naveen_summary
Beginner


Joined: 12 Feb 2007
Posts: 26
Topics: 13

PostPosted: Mon Mar 05, 2007 6:39 am    Post subject: Select generic string in a VB file Reply with quote

Hello Gurus

Can you help me use DFSORT to resolve these 2 questions.

1.
Quote:

Is it possible to know the position of a particular string in the record.
Eg: Find "Total Ded" in a VB record. This string can occur anywhere in the record.


2.
I have a VB length ranging from 1134 to 14254.

My data is arranged in below fashion anywhere in the record.

Quote:
datadata...."Total Ded (any number of spaces) $455.00 "...datadata


I need to extract this "Total Ded" and the amount ($234.00 here) from this variable length record.

How do I achieve this.

To illustrate in detail:

Quote:
Input file:

Record1: datadata...Total Dedspacespace$240.00spacedatadata
Record2: data...Total Dedspace$241.00spacedata

Outfile should be:

Record1: Total Ded $240.00
Record2: Total Ded $241.00

Regards,
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Mar 05, 2007 8:56 am    Post subject: Reply with quote

naveen_summary,

Try this

Code:

//STEP0200 EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD DSN=input vb file,
//            disp=shr
//SORTOUT  DD SYSOUT=*                                             
//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                                 
  INREC PARSE=(%00=(STARTAT=C'Total Ded',ENDBEFR=BLANKS,FIXLEN=10),
               %01=(STARTAT=C'$',ENDBEFR=BLANKS,FIXLEN=10)),       
      BUILD=(1,4,%00,%01)                                         
/*                                                                 


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Mon Mar 05, 2007 11:42 am    Post subject: Reply with quote

Kolusu,

Just a nit, but I'd use ENDBEFR=C' ' instead of ENDBEFR=BLANKS in %00 and %01. You'd only need ENDBEFR=BLANKS instead of ENDBEFR=C' ' if you wanted to advance past all of the blanks before the next %nn field. In this case, since you're using STARTAT, you don't need to advance past the blanks first.

naveen,

You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use DFSORT's PARSE function. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/
_________________
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
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Mar 05, 2007 12:57 pm    Post subject: Reply with quote

Frank Yaeger,

Thanks for the tip. I will keep that in mind

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
naveen_summary
Beginner


Joined: 12 Feb 2007
Posts: 26
Topics: 13

PostPosted: Tue Mar 06, 2007 6:50 am    Post subject: Reply with quote

Thanks Kolusu and Frank.
Back to top
View user's profile Send private message
jacky_ying
Beginner


Joined: 25 Jul 2004
Posts: 46
Topics: 20

PostPosted: Sat Mar 17, 2007 10:12 am    Post subject: Reply with quote

"parse" is really a powerful and useful stuff!
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: Sun Mar 18, 2007 12:01 pm    Post subject: Reply with quote

I'm glad you like it. I spent a lot of time "inventing", developing and documenting it for DFSORT, so it's nice to know the effort is appreciated. Very Happy
_________________
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
Page 1 of 1

 
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