View previous topic :: View next topic |
Author |
Message |
naveen_summary Beginner
Joined: 12 Feb 2007 Posts: 26 Topics: 13
|
Posted: Mon Mar 05, 2007 6:39 am Post subject: Select generic string in a VB file |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon Mar 05, 2007 8:56 am Post subject: |
|
|
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 |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Mon Mar 05, 2007 11:42 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon Mar 05, 2007 12:57 pm Post subject: |
|
|
Frank Yaeger,
Thanks for the tip. I will keep that in mind
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
naveen_summary Beginner
Joined: 12 Feb 2007 Posts: 26 Topics: 13
|
Posted: Tue Mar 06, 2007 6:50 am Post subject: |
|
|
Thanks Kolusu and Frank. |
|
Back to top |
|
 |
jacky_ying Beginner
Joined: 25 Jul 2004 Posts: 46 Topics: 20
|
Posted: Sat Mar 17, 2007 10:12 am Post subject: |
|
|
"parse" is really a powerful and useful stuff! |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Sun Mar 18, 2007 12:01 pm Post subject: |
|
|
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.  _________________ 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 |
|
 |
|
|