Page 1 of 1

Search String using JCL

PostPosted: Wed Jan 21, 2009 10:32 am
by ram23bal
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.

Re: Search String using JCL

PostPosted: Wed Jan 21, 2009 10:55 am
by dick scherrer
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?

Re: Search String using JCL

PostPosted: Wed Jan 21, 2009 11:02 am
by ram23bal
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.

Re: Search String using JCL

PostPosted: Wed Jan 21, 2009 11:38 am
by ram23bal
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.

Re: Search String using JCL

PostPosted: Wed Jan 21, 2009 11:40 am
by dick scherrer
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.

Re: Search String using JCL

PostPosted: Wed Jan 21, 2009 12:38 pm
by ram23bal
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.

Re: Search String using JCL

PostPosted: Thu Jan 22, 2009 1:04 am
by dick scherrer
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. . .

Re: Search String using JCL

PostPosted: Thu Jan 22, 2009 1:22 am
by Alissa Margulies
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,

Re: Search String using JCL

PostPosted: Thu Jan 22, 2009 1:35 am
by dick scherrer
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