IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Syncsort - Removing set of records.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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 Developer


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

PostPosted: Mon Jul 19, 2010 10:04 pm
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
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: 2481
Location: @my desk

PostPosted: Tue Jul 20, 2010 3:34 pm
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
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: 8797
Location: Welsh Wales

PostPosted: Tue Jul 20, 2010 6:18 pm
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: 2481
Location: @my desk

PostPosted: Wed Jul 21, 2010 7:22 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts JCL sortcard to print only the records DFSORT/ICETOOL 11
Search our Forums:

Back to Top