Sort Question



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

Sort Question

Postby rayngerfan » Thu Jul 28, 2011 5:30 pm

To Whom It May Concern:

I'm using this code to insert a record / line into members within a PDS that have 'PGM=INSYNC'. The below parameters work with the data
STEPLIB DD DSN=DYF.TEST.INSYNC.LOADLIB,DISP=SHR being writen on the next line after 'PGM=INSYNC'. Is there away to have the data writen after skipping two lines once 'PGM=INSYNC' is found?

OPTION COPY
OUTFIL IFTHEN=(WHEN=(15,13,CH,EQ,C'PGM=INSYNC'),
BUILD=(1,80,/,C'STEPLIB DD DSN=DYF.TEST.INSYNC.LOADLIB,DISP=SHR'))


Thanks
rayngerfan
 
Posts: 51
Joined: Fri Apr 17, 2009 4:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort Question

Postby BillyBoyo » Thu Jul 28, 2011 6:38 pm

rayngerfan wrote:To Whom It May Concern:

I'm using this code to insert a record / line into members within a PDS that have 'PGM=INSYNC'. The below parameters work with the data
STEPLIB DD DSN=DYF.TEST.INSYNC.LOADLIB,DISP=SHR being writen on the next line after 'PGM=INSYNC'. Is there away to have the data writen after skipping two lines once 'PGM=INSYNC' is found?

OPTION COPY
OUTFIL IFTHEN=(WHEN=(15,13,CH,EQ,C'PGM=INSYNC'),
BUILD=(1,80,/,C'STEPLIB DD DSN=DYF.TEST.INSYNC.LOADLIB,DISP=SHR'))


Thanks


That's going to mess up your JCL (assuming that is what you have)? Do you want to do that?

You are already doing one "newline" in your code. Did you try sticking in a couple more?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Sort Question

Postby enrico-sorichetti » Thu Jul 28, 2011 10:23 pm

the way I understand the question is ..
not to put empy ??? lines
but
input
//<stepnm> exec PGM=INSYNC,
// 1st continuation of the previous statement
// 2nd continuation of the previous statement

output
//<stepnm> exec PGM=INSYNC,
// 1st continuation of the previous statement
// 2nd continuation of the previous statement
//STEPLIB DD DISP=SHR,DSN=<datasetname>


or

input
//<stepnm> exec PGM=INSYNC,
// continuation of the previous statement

output
//<stepnm> exec PGM=INSYNC,
// continuation of the previous statement
//STEPLIB DD DISP=SHR,DSN=<datasetname>


depending on how the counting is done
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Sort Question

Postby BillyBoyo » Thu Jul 28, 2011 11:55 pm

Yes, enrico, that makes much more sense. I didn't get it.

If the second line of the continuation, or whatever it is that follows the "PGM=INSYNC" is also "standard", in that it is in the same position and same value, and does not occur elsewhere in the JCL, then you can use the technique you are already using, but change it to look for the different value.

If the same value, but not in fixed position you can scan.

However, you might not be that lucky. You might pick up something that is not from INSYNC if the second continuation is not unique to INSYNC.

If you have to rely on INSYNC, then you'll need a bit more jiggering about. Something like a sequence number set to 1000000 until you find INSYNC, when it can be set to 1. Then when the sequence is 3 (or two, depending on the counting) you can do your insert. Strip off the sequence numbers.

That is a broad approach. I'm sure it can be refined. Check how to define a GROUP or things like that.

I suspect you can even adjust it to do the insert after the first line which is not a continuation, though the ability to do inline comments in the JCL may cloud things.

If you show some samples of what it is you actually want, it'll help.

The more "standardised" your JCL is, the easier it is to change programatically.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Sort Question

Postby rayngerfan » Fri Jul 29, 2011 3:13 am

I appreciate the feedback. Some of the PROCS that are being changed have a continuation after PGM=INSYNC.

EX:
// PGM=INSYNC,
// REGION=4096K,
// COND=(0,EQ,STEP1)

When I insert STEPLIB DD DSN=DYF.TEST.INSYNC.LOADLIB,DISP=SHR after 'PGM=INSYNC' the JCL is going to be messed up. If I can skip 2 lines after 'PGM=INSYNC' is found,then the text string //STEPLIB DD DSN=DYF.TEST.INSYNC.LOADLIB,DISP=SHR would be in the correct palce.


// PGM=INSYNC,
// REGION=4096K,
// COND=(0,EQ,STEP1)
//STEPLIB DD DSN=DYF.TEST.INSYNC.LOADLIB,DISP=SHR

Thanks
rayngerfan
 
Posts: 51
Joined: Fri Apr 17, 2009 4:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort Question

Postby BillyBoyo » Fri Jul 29, 2011 4:59 am

Spot on enrico.

Plan A won't work either.

Are you going to dig into the manual and have a hack at Plan B yourself?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Sort Question

Postby rayngerfan » Fri Jul 29, 2011 5:55 am

Since there is only 30 PROCS that have a continuation, I can change these manaually. I was curious if there was an easy way to skip 2 lines and then add the text. Thanks for everyone's input.
rayngerfan
 
Posts: 51
Joined: Fri Apr 17, 2009 4:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort Question

Postby dick scherrer » Fri Jul 29, 2011 8:27 am

Hello,

I was curious if there was an easy way to skip 2 lines and then add the text.
Well, it would not be very difficult with code.

The lack of ease is the "rule" that it be done with your sort product. . .

Most folks would have done this with rexx or even program code if it was to be used in an ongoing basis. You posted your topic in the Syncsort part of the forum, so replies have been targeted to this.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post