I have a requirement that from a dataset (FBA, 133)
I have to find the occurence (would be there in dataset once only) of
1_| 332 |
i.e. starting string "1_|" and ending string "|", the string in between needs to be converted to a number. In this case it would be 332 and should become the returncode of my job.
So in this case the job should return 332
or return a non-zero(ex 4) return code if the number is > 0
else return 0
so this job should return 4.
Thanks in advance
Yes, I agree that writing a program is much simpler but introducing a new job with all dependencies in a production is tougher than introducing a new JCL. Hence the reason, I thought with DFSORT there could be a way.
Here's a z/OS DFSORT V1R5 job that will pass back RC=4 if the numeric value in the target record is greater than 0 (e.g. 332) or pass back RC=0 if the numeric value is <= 0 (e.g. 0 or -1). I assumed the target input record would always be present, that the numeric value would have a maximum of 10 characters, and that you didn't want any output records.
z/OS DFSORT V1R5 is required to use NULLOFL. If you have DFSORT R14, you can do the same kind of thing using ICETOOL's COUNT instead of NULLOFL.
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).
Thanks a lot for the solution, actually what I forgot to mention that the character "1_|" would not be the starting character in the line.
And yes you were right I actually used COUNT for achieving this
here's what I did