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

SYNCSORT Comparing Variable files to generate output


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
karpitha79

New User


Joined: 27 Dec 2007
Posts: 2
Location: Newyork

PostPosted: Thu Jan 03, 2008 12:04 am
Reply with quote

I have a file like below. The file is variable 256

Organization . . . : PS
Record format . . . : VB
Record length . . . : 256

Each record starts with a number and each record is separated by X'00'. You can see the first record started with 123456 and ended with X'00' (just
before second record 234567). List that last record 233333 eds with X'00' at the end. Apart from record separator we can see other dot (.) /period
within the file..they are X'0D', not X'00'

123456.
abcd
xxx
gggg
cvvvv
.234567.
Cccccccc.
Dddddddddd.
.999999.
ggggabcd
xxxgggg
ggggwwww
cvvvv nnn
.233333.
Ccjfjkhjkfhkjc.
Dkllkljlkj.
. <this is x'00'>

*REQUIREMENT:*

We get this file on daily basis from other application. Say now I have two
files, file01 and file02. Say the file02 is like below. That means in
file02, I have one extra record and one changed record. It is not guaranteed that the new records would be in the beginning. The order of file01 records may be changed in file02. Ok. In this case I need a output file with 000001 record and 123456 record (completely -not only changed text)

Here I am looking for different options from the group so that best can be
chosen. Any option with SYNCSORT?

*File02*

000001.
hshshshh
hhlkfklkljhl
mhglkjlkj
jjjgjgjgj
.123456.
CHANGED CHANGED
xxx
gggg
cvvvv
.234567.
Cccccccc.
Dddddddddd.
.999999.
ggggabcd
xxxgggg
ggggwwww
cvvvv nnn
.233333.
Ccjfjkhjkfhkjc.
Dkllkljlkj.
. <this is x'00'>

*OUTPUT should be:*

000001.
hshshshh
hhlkfklkljhl
mhglkjlkj
jjjgjgjgj
.123456.
CHANGED CHANGED
xxx
gggg
cvvvv
. <this is x'00'>
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jan 03, 2008 1:00 am
Reply with quote

Quote:
I have a file like below. The file is varibale 256

Organization . . . : PS
Record format . . . : VB
Record length . . . : 256


what You are describing is NOT a file/dataset in mainframes terms
thats just a stream of bytes that the file transfer protocol
ftp or 3270 send/receive stored in vb format..

to give a reasonable meaning to Your request You have to proceed in two steps

1) deblock... call it any way You want...
Your stream by storing every chunk of bytes between two "null" chars as a well behaving os record...
2) process with ... sort ??? ... the well built datasets
Back to top
View user's profile Send private message
karpitha79

New User


Joined: 27 Dec 2007
Posts: 2
Location: Newyork

PostPosted: Thu Jan 03, 2008 7:17 pm
Reply with quote

I also thought that make every record into one line but you know 32K limitation for a dataset in MF.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Jan 18, 2008 9:17 pm
Reply with quote

Have you referred your problem to the SYNCSORT technical support folks? I'm sure they could offer you a solution that will fit your needs.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Sat Jan 19, 2008 10:11 am
Reply with quote

karpitha79
In your sample output, you show
Code:
xxx
gggg
cvvvv
which were present in both the file-1 and file-2, why?

based on my understanding, i have given a SYNCTOOL solution, modify as per your requirement
Code:
//***************************
//STEP001  EXEC PGM=SYNCTOOL 
//TOOLMSG  DD SYSOUT=*       
//DFSMSG   DD SYSOUT=*       
//IN1      DD *             
123456.                     
ABCD                         
XXX                         
GGGG                         
CVVVV                       
.234567.                     
CCCCCCCC.                   
DDDDDDDDDD.                 
.999999.                     
GGGGABCD                     
XXXGGGG                     
GGGGWWWW                     
CVVVV NNN                   
.233333.                     
CCJFJKHJKFHKJC.
DKLLKLJLKJ.     
.               
//IN2    DD *   
000001.         
HSHSHSHH       
HHLKFKLKLJHL   
MHGLKJLKJ       
JJJGJGJGJ       
.123456.       
CHANGED CHANGED
XXX             
GGGG           
CVVVV           
.234567.       
CCCCCCCC.       
DDDDDDDDDD.     
.999999.       
GGGGABCD       
XXXGGGG       
GGGGWWWW       
CVVVV NNN     
.233333.       
CCJFJKHJKFHKJC.
DKLLKLJLKJ.   
.             
/*             
//TMP1     DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//TMP2     DD DSN=&&TEMP2,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUT      DD SYSOUT=*                                               
//TOOLIN   DD *                                                       
 COPY FROM(IN1) TO(TMP1) USING(CP01)                                 
 COPY FROM(IN2) TO(TMP1) USING(CP02)                                 
 SELECT FROM(TMP1) TO(TMP2) ON(1,20,CH) NODUPS USING(CP03)           
 SORT FROM(TMP2)  TO(OUT) USING(CP04)                                 
/*                                                                   
//CP01CNTL DD   *                                                     
  INREC OVERLAY=(89:C'1')                                             
/*                                                                   
//CP02CNTL DD   *                                                     
  INREC OVERLAY=(81:SEQNUM,8,ZD,89:C'2')                             
/*                                                                   
//CP03CNTL DD   *                                                     
  OUTFIL INCLUDE=(89,1,ZD,EQ,+2)                                     
//CP04CNTL DD   *                               
  SORT FIELDS=(81,8,ZD,A)                       
  OUTFIL FNAMES=OUT,BUILD=(1,80),TRAILER1=(X'00')
/*                                               



OUT contains
Code:
000001.         
HSHSHSHH         
HHLKFKLKLJHL     
MHGLKJLKJ       
JJJGJGJGJ       
.123456.         
CHANGED CHANGED 
.               
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 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top