Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SKIP/DELETE records only from a specific line

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
Maharam

New User


Joined: 21 Feb 2015
Posts: 4
Location: USA

PostPosted: Wed Feb 25, 2015 3:30 am    Post subject: SKIP/DELETE records only from a specific line
Reply with quote

Hi,
I'm trying to do the following.
1. Copy the JCL from one PDS to other PDS.
2. Skip/delete the below lines when you copy over.
// DD DSN=TEST.DHL.RR46916,
// DISP=SHR
// DD DSN=TEST.DHL.RR46919,
// DISP=SHR
// DD DSN=TEST.DHL.RR46927,
// DISP=SHR
// DD DSN=TEST.DHL.RR46928,
// DISP=SHR

3. Replace the last two digits of the first DSN in the SORTIN DD of STEP10, using a symbolic parameter.
Letz say the symbolic parameter has a value 18.
Before change:
//SORTIN DD DSN=TEST.DHL.RR46903,
// DISP=SHR

After Change:
//SORTIN DD DSN=TEST.DHL.RR46918,
// DISP=SHR

Here is the Source JCL that i want to copy.
//STEP10 EXEC SORTD,
// CYLS=60
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=TEST.DHL.RR46903,
// DISP=SHR
// DD DSN=TEST.DHL.RR46916,
// DISP=SHR
// DD DSN=TEST.DHL.RR46919,
// DISP=SHR
// DD DSN=TEST.DHL.RR46927,
// DISP=SHR
// DD DSN=TEST.DHL.RR46928,
// DISP=SHR
//SORTOUT DD DSN=&&RR469,
// DISP=(NEW,PASS,DELETE),
// DCB=(DSORG=PS,RECFM=FB,LRECL=16,BLKSIZE=0),
// SPACE=(CYL,(200,100),RLSE),
// UNIT=TEMPDISK
//SYSIN DD *
SORT FIELDS=(6,11,CH,A)
SUM FIELDS=NONE
/*
//STEP20 EXEC SORTD,
// CYLS=60
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=TEST.DHL.RR277,
// DISP=SHR
//SORTOUT DD DSN=&&RR277,
// DISP=(NEW,PASS,DELETE),
// DCB=(DSORG=PS,RECFM=FB,LRECL=22,BLKSIZE=0),
// SPACE=(CYL,(200,100),RLSE)
//SYSIN DD *
SORT FIELDS=(10,11,CH,A)

/*

I was able to do step 1 and 3. Can anyone please help with step 2?

//STEP10 EXEC SORTD
//SORTIN DD DSN=TEST.PRIM.JCL(JPDS1),DISP=SHR
//SYSOUT DD SYSOUT=*
//SORTOUT DD DSN=TEST.SEC.JCL(JPDS2),DISP=SHR
//SYMNAMES DD *
OFFICE,C'18'
//SYSIN DD *
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=INIT,
FINDREP=(STARTPOS=37,ENDPOS=39,INOUT=(C'03',OFFICE)))
/*

How do i skip lines 6 to 13. Please help.
Back to top
View user's profile Send private message

Guest







PostPosted: Wed Feb 25, 2015 9:17 pm    Post subject:
Reply with quote

Hi Maharam,

Is the lines to be skipped always in lines 6 to 13
Back to top
Maharam

New User


Joined: 21 Feb 2015
Posts: 4
Location: USA

PostPosted: Wed Feb 25, 2015 11:43 pm    Post subject: Reply to: SKIP/DELETE records only from a specific line
Reply with quote

Hi,
Thanks for looking into it. Yes, its always those lines(Unless there is a change in the JCL, which i hope wont be too often. icon_smile.gif)
I was thinking about doing that in two steps. Copy line 1 to 5 to a temp dataset 1 and line 14 to end to a temp dataset 2 and then concatenate both.

But i was looking for achieving it in single step. (I have to copy 50 similar JCLs. So if one takes 2 steps, then i have to code 100 steps for copying 50 JCLs. So tryinng to see if i could do that in one step.)
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Thu Feb 26, 2015 1:36 am    Post subject: Reply to: SKIP/DELETE records only from a specific line
Reply with quote

If the line-numbers will always be the same, you can append a sequence number temporarily and use OUTFIL OMIT= to get rid of the lines you don't want, and then BUILD to remove the temporary extension.
Back to top
View user's profile Send private message
Maharam

New User


Joined: 21 Feb 2015
Posts: 4
Location: USA

PostPosted: Thu Feb 26, 2015 9:38 pm    Post subject: Reply to: SKIP/DELETE records only from a specific line
Reply with quote

Thank you, Bill!
I was able to do everything except the BUILD part to get rid of the extensions.

//SYSIN DD *
INREC OVERLAY=(72:SEQNUM,8,ZD)
SORT FIELDS=COPY
OUTFIL OMIT=((72,8,ZD,EQ,31),OR,(72,8,ZD,EQ,32),OR,
(72,8,ZD,EQ,33),OR,(72,8,ZD,EQ,34),OR,
(72,8,ZD,EQ,35),OR,(72,8,ZD,EQ,36),OR,
(72,8,ZD,EQ,37),OR,(72,8,ZD,EQ,38))
OUTREC IFTHEN=(WHEN=INIT,
FINDREP=(STARTPOS=37,ENDPOS=39,INOUT=(C'XX',OFFICE))),
IFTHEN=(WHEN=INIT,
FINDREP=(STARTPOS=01,ENDPOS=02,INOUT=(C'YY',OFFICE))),
IFTHEN=(WHEN=INIT,
FINDREP=(INOUT=(C'ABCD',REGION)))
/*

When i add BUILD=(1,72) after the OMIT, i'm adding the below error.
WER247A SORTOUT HAS INCOMPATIBLE LRECL

How do i maintain the LRECL 80 and get rid of the temporary seqnum from 72 to 80?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Thu Feb 26, 2015 10:03 pm    Post subject: Reply to: SKIP/DELETE records only from a specific line
Reply with quote

Code:
  BUILD=(1,72,80:X)


That has your position one for a length of 72, puts a blank in position 80, and space-fills any intervening bytes. (1,72,8X), putting in eight blanks directly, would be the same.

You could also OVERLAY starting at 81. However, since you don't need the existing line-number data from the PDS member, you may as well re-use and then blank.

Try to use the Code tags when posting, to preserve spacing.
Back to top
View user's profile Send private message
Maharam

New User


Joined: 21 Feb 2015
Posts: 4
Location: USA

PostPosted: Thu Feb 26, 2015 10:24 pm    Post subject: Reply to: SKIP/DELETE records only from a specific line
Reply with quote

Sure, Bill!
Thanks a lot for the code. It worked. icon_smile.gif Thanks again.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 1 Fri Dec 09, 2016 4:40 am
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us