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
 

 

SYNCSORT Drop selected group of records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
vaibhavkolhe

New User


Joined: 24 Feb 2005
Posts: 11

PostPosted: Fri Jan 02, 2009 7:06 pm    Post subject: SYNCSORT Drop selected group of records
Reply with quote

Hi,

I have the following requirement:

There is a file consisting about 1 million records. I want to selectively bypass 3 records in between and copy all the records above & below it. For e.g. here's an example of this file:

Code:
...PRMGBSIC..................EãYUD 2500000
...PRMGSUMM..................E/d01........
..jPRMGLCMP..................E/ü..........
...PRMGBSIC..................EÂøYG 8000000   these
...PRMGSUMM..................EÂÞ01.....@..   three
..íPRMGHCMP..................EÄ.....æ....<   records
...PRMGBSIC..................EÄ;AG 2500000
...PRMGSUMM..................EÄæ01....èð..
..jPRMGLCMP..................EÄ4...èð....@


Here, I wanto to bypass 3 records starting from YG 800000 and copy the records above and below it into a new file. So, basically, after copying, it would look like

Code:
...PRMGBSIC..................EãYUD 2500000
...PRMGSUMM..................E/d01........
..jPRMGLCMP..................E/ü..........
...PRMGBSIC..................EÄ;AG 2500000
...PRMGSUMM..................EÄæ01....èð..
..jPRMGLCMP..................EÄ4...èð....@


How can this be achieved using SYNCSORT?

Thanks.
VK
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2238
Location: @my desk

PostPosted: Fri Jan 02, 2009 7:13 pm    Post subject:
Reply with quote

vaibhavkolhe,

What is the RECFM/LRECL of your input file?
Also do you have only a single "YG 800000" record in your input file?
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Fri Jan 02, 2009 10:32 pm    Post subject:
Reply with quote

For SYNCSORT you might need to give more details about your file and its records.

As another thought, if your unwanted records exist sequentially and you know their line count you can also try doing a REPRO, something like this:

Code:

//STEP1    EXEC PGM=IDCAMS,COND=(4,LT)                 
//SYSPRINT DD SYSOUT=*                                 
//SYSOUT DD SYSOUT=*                                   
//INDD   DD DSN=<INPUT DSN>,DISP=SHR 
//OUTDD  DD DSN=<OUTPUT DSN>,         
// DISP=(NEW,KEEP,KEEP),                               
// DCB=(RECFM=FB,LRECL=120,BLKSIZE=0),                 
// SPACE=(CYL,(10,10),RLSE)                             
//SYSIN DD *                                           
  REPRO INFILE(INDD) OUTFILE(OUTDD) COUNT(90)           
/*                                                     
//STEP2    EXEC PGM=IDCAMS,COND=(4,LT)                 
//SYSPRINT DD SYSOUT=*                                 
//SYSOUT DD SYSOUT=*                                   
//INDD   DD DSN=<INPUT DSN>,DISP=SHR 
//OUTDD  DD DSN=<OUTPUT DSN>,DISP=MOD 
//SYSIN DD *                                           
  REPRO INFILE(INDD) OUTFILE(OUTDD) SKIP(94)
/*                                           
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Sat Jan 03, 2009 5:00 pm    Post subject: Reply to: SYNCSORT query-please help!!
Reply with quote

Would the STARTREC, ENDREC or STOPAFT with SKIPREC help in this case? May be with two passes !
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sat Jan 03, 2009 6:27 pm    Post subject: Re: SYNCSORT query-please help!!
Reply with quote

Code:
...PRMGBSIC..................EÂøYG 8000000   these
...PRMGSUMM..................EÂÞ01.....@..   three
..íPRMGHCMP..................EÄ.....æ....<   records

VK,

Can the "PRMGBSIC" be treated as a "header" and the "8000000" be treated as the "value"?
Deleting a headered group of records on the fly should be do-able.....
Back to top
View user's profile Send private message
vaibhavkolhe

New User


Joined: 24 Feb 2005
Posts: 11

PostPosted: Sat Jan 03, 2009 10:31 pm    Post subject: Reply to: SYNCSORT Drop selected group of records
Reply with quote

Hi,

Here are the answers to some of the answers in previous posts:

- The RECFM = VB & LRECL = 27998.

- I do not know the count of records in this file, so I am not sure if I can use STOPAFT, SKIPREC. Is there a method to find the count of records in the file.

- There are 3 "YG 80" records in the file, but the one I want to eliminate can be uniquely identified by "YG 8000000".

Thanks,
Vaibhav
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2238
Location: @my desk

PostPosted: Sun Jan 04, 2009 2:39 pm    Post subject:
Reply with quote

vaibhavkolhe,

I believe the below SyncSort job might help. From the sample data you posted, I have assumed the position of 'YG 8000000' at 37th pos(including RDW).

Code:
//STEP00  EXEC PGM=SORT                                               
//SORTIN    DD DSN= Input file  VB/LRECL=27998                         
//SORTOUT   DD DSN= Output file VB/LRECL=27998                         
//SYSOUT    DD SYSOUT=*                                               
//SYSIN     DD *                                                       
 INREC IFTHEN=(WHEN=(37,10,CH,NE,C'YG 8000000'),BUILD=(1,4,C'0',30:5)),
       IFTHEN=(WHEN=NONE,BUILD=(1,4,C'1',30:5))                       
 SORT FIELDS=COPY                                                     
 OUTREC OVERLAY=(6:SEQNUM,8,ZD,RESTART=(5,1),                         
                   SEQNUM,8,ZD,RESTART=(6,8),                         
                   SEQNUM,8,ZD,RESTART=(14,8))                         
 OUTFIL BUILD=(1,4,5:30),                                             
        OMIT=(05,1,ZD,EQ,1,OR,                                         
              14,8,ZD,EQ,2,OR,                                         
             (06,8,ZD,EQ,2,AND,22,8,ZD,EQ,1))       
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Why TS/OP would Not contact site supp... RahulG31 All Other Mainframe Topics 2 Wed Mar 22, 2017 7:46 am
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


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