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 Comparing Variable files to generate output

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SYNCSORT Comparing Variable files to generate output
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Thu Jan 03, 2008 1:00 am    Post subject: Reply to: Comparing Variable files to generate output
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    Post subject: Re: Comparing Variable files to generate output
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

Moderator Team Head


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

PostPosted: Fri Jan 18, 2008 9:17 pm    Post subject: Reply to: SYNCSORT Comparing Variable files to generate outp
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    Post subject:
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    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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


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