Search String using JCL



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Search String using JCL

Postby ram23bal » Wed Jan 21, 2009 10:32 am

Hi All,

I am struck up with String search. I have the below requirement.


1)My input Sequential file looks like

XXXX START NAME CLASS ROLLNO END

2)My requirement is to copy the contents between START and END to another Sequential file.

say I need NAME CLASS ROLLNO.



Is this possible with sort card. I tried using string search but unable to extract datas between Start and End.
ram23bal
 
Posts: 33
Joined: Sat May 24, 2008 3:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Search String using JCL

 

Re: Search String using JCL

Postby dick scherrer » Wed Jan 21, 2009 10:55 am

Hello,

Which sort product is used on your system?

Is there some requirement to use the sort product or would other code do as well??

Will the START and the END always be in order on the same line?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Search String using JCL

Postby ram23bal » Wed Jan 21, 2009 11:02 am

Hello,

Which sort product is used on your system?

Is there some requirement to use the sort product or would other code do as well??

Will the START and the END always be in order on the same line?


Hi Dick,

I cannot get your first question.
Requiremnt is to do with JCL.
No START and END column Position will differ for each records.
ram23bal
 
Posts: 33
Joined: Sat May 24, 2008 3:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Search String using JCL

Postby ram23bal » Wed Jan 21, 2009 11:38 am

DICK,

To add with the requirement we just know the starting and ending string name(START and END alone). Length of the content can vary.
ram23bal
 
Posts: 33
Joined: Sat May 24, 2008 3:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Search String using JCL

Postby dick scherrer » Wed Jan 21, 2009 11:40 am

Hello,

1. which sort product is used on your system - probably dfsort or syncsort - so, which is used.

2.
Requiremnt is to do with JCL.
JCL can do nothing by itself. JCL executes programs. Generic programs to manipulate data have their own syntax for their "code". You will have to choose a utility and prepare the needed syntax, if possible.

3
No START and END column Position will differ for each records.
Show samples of all possible input that this process must be able to handle.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Search String using JCL

Postby ram23bal » Wed Jan 21, 2009 12:38 pm

Hi,

1)We are using SYNCSORT.

2)What I ment is, can this be done with JCL utilities(SYNCSORT)

3)The file will be generated on daily basis and it contains just one record

DAY one

INPUT FILE

aaaazzzzsssssddddSTARTaaaaaaaaadddddddffffgggghhhjjEND

Day two input file may be

aaaazzzzsssssddddSTARTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaddddddddddddddddddddddfffffffffffgggggggggghhhjjEND

what ever may be the input file I need the contents Between START and END.
ram23bal
 
Posts: 33
Joined: Sat May 24, 2008 3:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Search String using JCL

Postby dick scherrer » Thu Jan 22, 2009 1:04 am

Hello,

How would a process know the length of the record? Is there some field in the record that contains information that could be used to determine length (like an occurs depending on)?

If this was my requirement, i would change the process that creates the single-record to create another file with a fixed-length record of max size that only contains the data between the start/end.

How is the data between the start/end to be used if the content/size is not known?

fwiw. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Search String using JCL

Postby Alissa Margulies » Thu Jan 22, 2009 1:22 am

Dick,

Ram had emailed me directly and this is the solution I provided:

//SYSIN DD *
  SORT FIELDS=COPY
  INREC PARSE=(%00=(STARTAT=C'START',ENDAT=C'END',FIXLEN=80)),
  BUILD=(1:%00)
/*

FIXLEN can be modified to reflect the maximum possible length of the field.

Note that this job would require SyncSort for z/OS 1.3 and would not work on earlier releases of the product.

Best Regards,
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: Search String using JCL

Postby dick scherrer » Thu Jan 22, 2009 1:35 am

Hi Alissa,

Thanks for the follow-up.

My mind still boggles at what kind of business requirement would yield such a design. . . :? Also, at how such data might be used going forward in an application.

d
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post