Posted: Mon Nov 14, 2005 12:21 pm Post subject: Replace COBOL with SYNCSORT
Hi,
i have 2 input files ( one is look up file and another is the driver file). The driver file
consists of more than 4 million records.
Currently we are using a cobol program to check if the KEY in a driver file has a match on the lookup file
if it does then we are moving some fields from lookup file to the driver file else we are moving ZEROES to the driver file.
Now can this be achieved by using SYNCSORT ? if yes, can any one let me know how to go about getting this?
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
Posted: Mon Nov 14, 2005 6:33 pm Post subject:
tattva,
From your sysout it appears that you have syncsort z/os 1.1 which supports SPLICE.
1. what are the DCB parameters of both the files?
2. What is the matching key and its position and format?
3. Are there any duplicates in either of the files.
4. A sample input and desired output
Thanks
Kolusu
PS: The solution for sure will run longer than your cobol program _________________ Kolusu
www.linkedin.com/in/kolusu
1. what are the DCB parameters of both the files?
>>DCB=(RECFM=FB,LRECL=277,BLKSIZE=0,BUFNO=30)
2. What is the matching key and its position and format?
>> Matching Key : - St Pos :- 112 , format : -S9(09) COMP-3
3. Are there any duplicates in either of the files.
>> Yes there will be duplicates in the driver file.
4. A sample input and desired output
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
Posted: Tue Nov 15, 2005 12:50 pm Post subject:
Tattva,
Here is a sample JCL which will give you the desired results. I did not code it for your dcb parameters as I did not have time to test it and also I am not sure of the positions to be replaced.
I assumed that you want to replace the contents from pos6 thru pos30 if there is match in the 2nd file. If not , then you want to replace the key which is pos 1 thru pos 5.
PRODUCT LICENSED FOR CPU SERIAL NUMBER 215A2, MODEL 2064 1C6
CTL3CNTL :
OUTFIL FNAMES=M3,INCLUDE=(81,30,CH,EQ,C' '),
OUTREC=(5C'0',6,75)
OUTFIL FNAMES=M4,OMIT=(81,30,CH,EQ,C' ',OR,6,25,CH,EQ,86,25,CH),
OUTREC=(81,30,31,50)
//CTL4CNTL DD *
*
SORT FIELDS=(1,5,CH,A)
OUTFIL FNAMES=OUT
/*
*
WER428I CALLER-PROVIDED IDENTIFIER IS "0003"
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
I have a couple of doubts here. I tried running this for some other files ( whose desc are mentioned below), But that doesnt seem it be working the way i want. Could you please look in this?
Lookup file :- LRECL = 108 Key :- St pos : 5 length : 4 Type : BI
Driver file ;- LRECL = 132 Key :- St Pos : 21 Length : 4 Type : BI
Here's what it needs to do :-
Check if the key matches
If Yes
Move (1,4) from Lookup file to (9,4) of the outfile
IF NO
Move ZEROES to (9,4) to outfile
END-IF
and move all the other contents from driver file to output file.
Here are the changes that i did to the sample JCL that u provided
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
Posted: Wed Nov 16, 2005 12:26 pm Post subject:
tattva,
Try to understand the JCL posted by me. The example I have shown is for 80 byte length files. so I am adding the contents from file2 to file1 at 81st byte. But in your case your input lrecl is 132 and you need to actually add the contents of file2 at pos 133.
Look at your CTL3CNTL and see where you made a mistake.
You won't learn a bit just by copying the code. You need to understand and apply it for other applications.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum