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



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

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

Postby Raja190 » Thu Mar 17, 2016 1:25 pm

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.
Raja190
 
Posts: 36
Joined: Mon Dec 14, 2015 8:13 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby Aki88 » Thu Mar 17, 2016 1:53 pm

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.
Aki88
 
Posts: 381
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 36 times

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

Postby Raja190 » Thu Mar 17, 2016 4:23 pm

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
Raja190
 
Posts: 36
Joined: Mon Dec 14, 2015 8:13 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby BillyBoyo » Thu Mar 17, 2016 4:49 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby Raja190 » Thu Mar 17, 2016 4:50 pm

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'
/*
Raja190
 
Posts: 36
Joined: Mon Dec 14, 2015 8:13 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby NicC » Thu Mar 17, 2016 4:54 pm

This (above) is what is expected. I have also removed the jobcard as it is irrelevant and too site-specific.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

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

Postby Raja190 » Thu Mar 17, 2016 4:56 pm

oh ok. Thanks for clarifying.

Now, shall we get in to for what I actually posted this ?
Raja190
 
Posts: 36
Joined: Mon Dec 14, 2015 8:13 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby NicC » Thu Mar 17, 2016 5:09 pm

Billy already suggested something so why not look it up and try it. Come back with the result.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

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

Postby Raja190 » Thu Mar 17, 2016 5:51 pm

Billy,

Could you please explain me more in detail about CHNG. I can't find anything for it.
Raja190
 
Posts: 36
Joined: Mon Dec 14, 2015 8:13 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby BillyBoyo » Thu Mar 17, 2016 6:47 pm

BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

PreviousNext

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post