Page 2 of 3

Re: Search a string in PDS with 2 lines prior & after.

PostPosted: Thu Mar 17, 2016 1:25 pm
by Raja190
Hi Billy,

Thanks for jumping in here. I was expecting you actually :)...

Still I don't understand what you , Terry and others are expecting.


could you please explain me more in detail.

Re: Search a string in PDS with 2 lines prior & after.

PostPosted: Thu Mar 17, 2016 1:53 pm
by Aki88
Hello,

What Terry and the moderators have been requesting you to do, is to use the function called 'CODE TAGS' while posting any code/sample-data in your post.
Simply put, the input and output data that you have shared in your original post can be 'Coded', this helps in preserving the spaces and other intricacies of actual data posted by user.

This can be done by clicking 'Post-Reply' button while replying to a thread on the forum.
Once you click 'Post-Reply', you should be able to see various options given above the text-box area, one of the options is - 'Code', click the same, and post your 'Sample Data' with the 'Tags' that are auto-created for you in the text-area. Code tags usually look like --> [ code ] [ /code ] (actual tags do not have spaces).

Hope this clears the air.

Re: Search a string in PDS with 2 lines prior & after.

PostPosted: Thu Mar 17, 2016 4:23 pm
by Raja190
Hi,

I Guess this is what you are expecting me to do.

I can do usual search by using below JCL, but i want something else given in exmple.


//SRCHFOR JOB (,,time,lines),'your name',CLASS=class
// EXEC PGM=ISRSUPC,
//NEWDD DD DSN=your.data.set.name,DISP=OLD
//OUTDD DD SYSOUT=*
//SYSIN DD *
SRCHFOR 'string1'
/*



Example input:

this is line number 1
this is line number 2
this is line number 3
this is line number 4
this is line number 5
this is line number 6



Expected result.

Srchfor 'line4' with 2 lines prior and after

this is line number 2
this is line number 3
this is line number 4
this is line number 5
this is line number 6

Re: Search a string in PDS with 2 lines prior & after.

PostPosted: Thu Mar 17, 2016 4:49 pm
by BillyBoyo
Note quite. If you type the tags manually, it is [ c o d e ] to open the line/block and [ / c o d e ] to close the line/block. Without the blanks, which just represent you pausing between each key (and to prevent a real tag being created).

Terry and Aki88 have given you instructions. Did you try to follow them? Highlight a block/line, click the Code button. It's done. Use Preview to check that all is OK. The key thing is to use PostReply not QuickReply, or to click on Full Editor if you use QuickReply.

Anyway, for what you want, look at CHNG.

Re: Search a string in PDS with 2 lines prior & after.

PostPosted: Thu Mar 17, 2016 4:50 pm
by Raja190
Example:

this is line number 1
this is line number 2
this is line number 3
this is line number 4
this is line number 5
this is line number 6



Expected result.

Srchfor 'line3' with 2 lines prior and after

this is line number 2
this is line number 3
this is line number 4
this is line number 5
this is line number 6



// EXEC PGM=ISRSUPC,
//NEWDD DD DSN=your.data.set.name,DISP=OLD
//OUTDD DD SYSOUT=*
//SYSIN DD *
SRCHFOR 'string1'
/*

Re: Search a string in PDS with 2 lines prior & after.

PostPosted: Thu Mar 17, 2016 4:54 pm
by NicC
This (above) is what is expected. I have also removed the jobcard as it is irrelevant and too site-specific.

Re: Search a string in PDS with 2 lines prior & after.

PostPosted: Thu Mar 17, 2016 4:56 pm
by Raja190
oh ok. Thanks for clarifying.

Now, shall we get in to for what I actually posted this ?

Re: Search a string in PDS with 2 lines prior & after.

PostPosted: Thu Mar 17, 2016 5:09 pm
by NicC
Billy already suggested something so why not look it up and try it. Come back with the result.

Re: Search a string in PDS with 2 lines prior & after.

PostPosted: Thu Mar 17, 2016 5:51 pm
by Raja190
Billy,

Could you please explain me more in detail about CHNG. I can't find anything for it.

Re: Search a string in PDS with 2 lines prior & after.

PostPosted: Thu Mar 17, 2016 6:47 pm
by BillyBoyo