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 - Removing set of records.

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

New User


Joined: 28 Jul 2006
Posts: 60
Location: Mumbai

PostPosted: Mon Jul 19, 2010 5:08 pm    Post subject: Syncsort - Removing set of records.
Reply with quote

Hi ,

Please do advise me on the below query.

While merging two files i need to remove the set of records if any header record is duplicated in both the file.

For Example:

File1 contains records as

Code:

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX7777XXXXX   
AAAAAAAAAAAAAA                                 
BBBBBBBBBBBBBB                                 
CCCCCCCCCCCCCC                                 
dddddddddddddd                                 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX8888XXXXX   
AAAAAAAAAAAAAA                                 
BBBBBBBBBBBBBB                                 
CCCCCCCCCCCCCC                                 
DDDDDDDDDDDDDD                                 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX9999XXXXX   
AAAAAAAAAAAAAA                                 
BBBBBBBBBBBBBB                                 
CCCCCCCCCCCCCC                                 
dddddddddddddd                                 


File 2 Contains record as

Code:

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1111XXXXX
AAAAAAAAAAAAAA                             
BBBBBBBBBBBBBB                             
CCCCCCCCCCCCCC                             
dddddddddddddd                             
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1122XXXXX
AAAAAAAAAAAAAA                             
BBBBBBBBBBBBBB                             
CCCCCCCCCCCCCC                             
DDDDDDDDDDDDDD                             
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX7777XXXXX
EEEEEEEEEEEEEEEEE                           
FFFFFFFFFFFFFFFFFFFF                       
GGGGGGGGGGGGG                               
HHHHHHHHHHHHHHH                             
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1233XXXXX
AAAAAAAAAAAAAA                             
BBBBBBBBBBBBBB                             
CCCCCCCCCCCCCC                             
DDDDDDDDDDDDDD                             


The header record with 7777 is same as in both files. Need to write only data related to 7777 from the file1. Tried using splice 3rd example in application guide(SC26-7523-03) but couldnt remove the set of records and the order of file is getting changed.

Output file :

Code:

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX7777XXXXX     
AAAAAAAAAAAAAA                                 
BBBBBBBBBBBBBB                                 
CCCCCCCCCCCCCC                                 
dddddddddddddd                                 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX8888XXXXX     
AAAAAAAAAAAAAA                                 
BBBBBBBBBBBBBB                                 
CCCCCCCCCCCCCC                                 
DDDDDDDDDDDDDD                                 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX9999XXXXX     
AAAAAAAAAAAAAA                                 
BBBBBBBBBBBBBB                                 
CCCCCCCCCCCCCC                                 
dddddddddddddd                                 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1111XXXXX -43
AAAAAAAAAAAAAA                                 
BBBBBBBBBBBBBB                                 
CCCCCCCCCCCCCC                                 
dddddddddddddd                                 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1122XXXXX     
AAAAAAAAAAAAAA                                 
BBBBBBBBBBBBBB                                 
CCCCCCCCCCCCCC                                 
DDDDDDDDDDDDDD                                 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1233XXXXX     
AAAAAAAAAAAAAA                                 
BBBBBBBBBBBBBB                                 
CCCCCCCCCCCCCC                                 
DDDDDDDDDDDDDD                                 


Is there someway i could merge file without changing the order of the file and need to write the duplicate record to file3 only from file1.

Please suggest.
Back to top
View user's profile Send private message

jose.jeyan

New User


Joined: 28 Jul 2006
Posts: 60
Location: Mumbai

PostPosted: Mon Jul 19, 2010 7:12 pm    Post subject:
Reply with quote

1)Sequence Number for first 4 bytes is nothing but the ISPF screen number. Nothing to worry about it. Actual record start from X in header and A in detail.
2) LRECL is 68 and recfm is FB
3) Headers can be identfied as XXXXXX for first 6 bytes.
4) DFSORT Z/OS v1.10

And CICS guy i will post my JCL soon..
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Jul 19, 2010 10:04 pm    Post subject:
Reply with quote

I removed the sequence numbers from your first post and used ubb code tags.

It looks like you're showing what you got for output, not what you want for output - right? Please show an example of your expected output that corresponds to your example of input.

Please run this job and post the //SYSOUT messages so I can determine your DFSORT level:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DUMMY
//SYSIN    DD    *
    OPTION COPY
/*
Back to top
View user's profile Send private message
jose.jeyan

New User


Joined: 28 Jul 2006
Posts: 60
Location: Mumbai

PostPosted: Tue Jul 20, 2010 1:29 pm    Post subject:
Reply with quote

Hi Frank,

First input file1 contains three set of records.
Second input file2 contains four set of records.
One set contains (One header and mutiple detail records).

The below given header record is duplicated in both the file.

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX7777XXXXX

If we merge both the files we will have all seven set of records in output file.But in the given output file(File3) we have only six set of records where
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX7777XXXXX and its detail records are carried from first file to the output file. Second file data is eliminated for this duplicated header record.

The output file given below is what i am expecting.

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX7777XXXXX
AAAAAAAAAAAAAA
BBBBBBBBBBBBBB
CCCCCCCCCCCCCC
dddddddddddddd
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX8888XXXXX
AAAAAAAAAAAAAA
BBBBBBBBBBBBBB
CCCCCCCCCCCCCC
DDDDDDDDDDDDDD
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX9999XXXXX
AAAAAAAAAAAAAA
BBBBBBBBBBBBBB
CCCCCCCCCCCCCC
dddddddddddddd
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1111XXXXX AAAAAAAAAAAAAA
BBBBBBBBBBBBBB
CCCCCCCCCCCCCC
dddddddddddddd
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1122XXXXX
AAAAAAAAAAAAAA
BBBBBBBBBBBBBB
CCCCCCCCCCCCCC
DDDDDDDDDDDDDD
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1233XXXXX
AAAAAAAAAAAAAA
BBBBBBBBBBBBBB
CCCCCCCCCCCCCC
DDDDDDDDDDDDDD

Given below is the sysout message to determine DFSORT level.

SYNCSORT FOR Z/OS 1.3.2.1R U.S. PATENTS: 4210961, 5117495 (C)
z/OS 1.10.0

SYSIN :
OPTION COPY
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER110I SORTOUT : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER054I RCD IN 1, OUT 1
WER169I RELEASE 1.3 BATCH 0506 TPF LEVEL 2.1
WER052I END SYNCSORT -
S1,,DIAG=AE00,6002,822E,00CE,E6D2,

Please advise.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Jul 20, 2010 3:34 pm    Post subject:
Reply with quote

You dont have DFSORT. The SYSOUT messages suggest that your shop uses Syncsort. The topic will be moved to JCL forum where Syncsort topics are discussed.
Back to top
View user's profile Send private message
jose.jeyan

New User


Joined: 28 Jul 2006
Posts: 60
Location: Mumbai

PostPosted: Tue Jul 20, 2010 6:14 pm    Post subject:
Reply with quote

Hi Arun is there some options available in syncsort to perform the above query.
I have used ICTOOL splice, and it does works fine with the syncsort. So does that mean i am not able to use ICETOOL commands.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Jul 20, 2010 6:18 pm    Post subject:
Reply with quote

ICETOOL will almost certainly be an alias pointing to SYNCTOOL, which may or may not contain the same functionalities.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Jul 21, 2010 7:22 pm    Post subject:
Reply with quote

jose.jeyan,

The below SYNCTOOL application might be of help. I assumed the input/output LRECLs be 86 and the postion of the key in the header as 35,4. I could nt test this with actual files as I am yet to get my mainframe id icon_smile.gif

Code:
//STEP0  EXEC PGM=SORT                                             
//SORTIN   DD *
//SYSOUT   DD SYSOUT=*
//SORTOUT  DD DSN=&HDR,DISP=(,PASS)                                               
//SYSIN    DD *
 OPTION COPY
 OUTFIL REMOVECC,NODETAIL,TRAILER1=('HDR',86:X)
/*
//STEP1  EXEC PGM=SYNCTOOL                                           
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                                     
//IN       DD DSN=&HDR,DISP=SHR,VOL=REF=*.STEP0.SORTOUT
//         DD DSN=Input file-1 ---->FB/LRECL=86
//         DD DSN=&HDR,DISP=SHR,VOL=REF=*.STEP0.SORTOUT
//         DD DSN=Input file-2 ---->FB/LRECL=86
//T1       DD DSN=&T1,DISP=(,PASS)
//OUT      DD DSN=Output file ---->FB/LRECL=86
//TOOLIN   DD *
  SORT FROM(IN) TO(T1)  USING(CTL1) 
  SORT FROM(T1) TO(OUT) USING(CTL2)
//CTL1CNTL DD *
 INREC IFTHEN=(WHEN=INIT,OVERLAY=(87:SEQNUM,8,ZD)),
       IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'HDR'),PUSH=(99:ID=1)),
       IFTHEN=(WHEN=GROUP,BEGIN=(1,6,CH,EQ,C'XXXXXX'),PUSH=(95:35,4))
 SORT FIELDS=(95,4,CH,A),EQUALS                                       
 OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(101:SEQNUM,8,ZD,RESTART=95,4)),
        IFTHEN=GROUP,BEGIN=(101,8,ZD,EQ,1),PUSH=(100:99,1)),
 OUTFIL OMIT=(1,3,CH,EQ,C'HDR',OR,99,2,ZD,EQ,21)
//CTL2CNTL DD *
 SORT FIELDS=(87,8,CH,A)
 OUTFIL BUILD=(1,86)
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 Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am


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