MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Replace COBOL with SYNCSORT
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
tattva
Beginner


Joined: 02 Feb 2005
Posts: 97
Topics: 36

PostPosted: Mon Nov 14, 2005 12:21 pm    Post subject: Replace COBOL with SYNCSORT Reply with quote

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?

Any help in this regard will be appreciated.

Thanks,
Tattva
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Mon Nov 14, 2005 2:03 pm    Post subject: Reply with quote

tattva,

Is this question related to this topic ?

http://www.mvsforums.com/helpboards/viewtopic.php?p=24944

Run the following Job and post the output of sysout here, which will give us an idea about the version of syncsort we are dealing.

Code:

//STEP0100  EXEC PGM=SORT
//SYSOUT    DD SYSOUT=*
//SORTIN    DD *
test
//SORTOUT   DD SYSOUT=*
//SYSIN     DD *                                           
  SORT FIELDS=COPY                                         
/*                       



kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tattva
Beginner


Joined: 02 Feb 2005
Posts: 97
Topics: 36

PostPosted: Mon Nov 14, 2005 2:55 pm    Post subject: Reply with quote

Hi Kolusu,

The question is not related to the previous one.

The Sysout :-

1 SYNCSORT FOR Z/OS 1.1BR TPF3A U.S. PATENTS: 4210961, 5117495 (C) 2002 SYN
z/OS 1.4.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 2120A, MODEL 2064 1C4 LICE
SYSIN :
SORT FIELDS=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.1B BATCH 0385 TPF LEVEL 3A
WER052I END SYNCSORT - A56J0810,STEP0100,,DIAG=8000,C248,A882,A464,C87E,6CE2,
Back to top
View user's profile Send private message
tattva
Beginner


Joined: 02 Feb 2005
Posts: 97
Topics: 36

PostPosted: Mon Nov 14, 2005 5:36 pm    Post subject: Reply with quote

Can anyone body please look into this ?? Sad

Thanks,
Tattva
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Mon Nov 14, 2005 6:33 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tattva
Beginner


Joined: 02 Feb 2005
Posts: 97
Topics: 36

PostPosted: Tue Nov 15, 2005 10:35 am    Post subject: Reply with quote

Hi Kolusu,

Please find my answers inline.

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

Driver file :-

11111bbbbbbbbbbbbbbbbbbbb
11111xxxxxxxxxxxxxxxxxxxx
12134aaaaaaaaaaaaaaaaaaaa
33333ccccccccccccccccccccccc

Lookup file:-

111111wwwwwwwwwwwwwww
222222rrrrrrrrrrrrrrrrrrrrrrrrrrr
333333qqqqqqqqqqqqqqqqqqq

Output file :-
11111wwwwwwwwwwwwwwww
11111wwwwwwwwwwwwwwww
00000aaaaaaaaaaaaaaaaaaaa
33333qqqqqqqqqqqqqqqqqqqq

Note :- these are only the fields that we will be replacing.

Thanks,
Tattva
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Tue Nov 15, 2005 12:50 pm    Post subject: Reply with quote

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.


Code:

//STEP0100 EXEC PGM=SYNCTTOOL       
//TOOLMSG  DD SYSOUT=*           
//DFSMSG   DD SYSOUT=*           
//IN1      DD *                   
11111BBBBBBBBBBBBBBBBBBBBBBBBB   
11111XXXXXXXXXXXXXXXXXXXXXXXXX   
12134AAAAAAAAAAAAAAAAAAAAAAAAA   
33333CCCCCCCCCCCCCCCCCCCCCCCCC   
//IN2      DD *                   
11111WWWWWWWWWWWWWWWWWWWWWWWWW   
22222RRRRRRRRRRRRRRRRRRRRRRRRR   
33333QQQQQQQQQQQQQQQQQQQQQQQQQ   
//M1       DD DSN=&M1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)         
//M2       DD DSN=&M2,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)         
//M3       DD DSN=&M3,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)         
//M4       DD DSN=&M4,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)         
//CON1     DD DSN=*.M2,VOL=REF=*.M2,DISP=SHR                     
//         DD DSN=*.M1,VOL=REF=*.M1,DISP=SHR                     
//CON2     DD DSN=*.M3,VOL=REF=*.M3,DISP=SHR                     
//         DD DSN=*.M4,VOL=REF=*.M4,DISP=SHR                     
//OUT      DD SYSOUT=*                                           
//TOOLIN   DD *                                                   
  COPY FROM(IN1) USING(CTL1)                                     
  SORT FROM(IN2) USING(CTL2)                                     
  SPLICE FROM(CON1) TO(M3) ON(1,5,CH) -                           
  WITH(1,80) WITHALL USING(CTL3) KEEPNODUPS                     
  SORT FROM(CON2) USING(CTL4)                                     
//CTL1CNTL DD *                                                   
  OUTFIL FNAMES=M1,                                               
  OUTREC=(1,80,30X)                                         
//CTL2CNTL DD *                                                   
  SORT FIELDS=(1,5,CH,A)                                         
  OUTFIL FNAMES=M2,                                               
  OUTREC=(1,80,1,30)                                         
//CTL3CNTL DD *                                                   
  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                                               
/*


To fully understand this job, try running the job with permanent datasets and see how it works. pay attention to the contents after pos 80.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tattva
Beginner


Joined: 02 Feb 2005
Posts: 97
Topics: 36

PostPosted: Tue Nov 15, 2005 3:16 pm    Post subject: Reply with quote

Hi Kolusu,

Thanks for the JCL . i tried running the same. But it is abending with MAXCC=16. below is the TOOLMSG

SYT015I PROCESSING MODE CHANGED FROM "STOP" TO "SCAN" DUE TO OPERATION FAILURE

SORT FROM(CON2) USING(CTL4)
SYT019I STATEMENT VALID; NOT PROCESSED DUE TO "SCAN" PROCESSING MODE

SYT004I SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 16

Could you please let me know what is worng here ?

Thanks,
Tattva
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Tue Nov 15, 2005 3:22 pm    Post subject: Reply with quote

tattva,

You need to post the DFSMSG messages also !

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tattva
Beginner


Joined: 02 Feb 2005
Posts: 97
Topics: 36

PostPosted: Tue Nov 15, 2005 3:56 pm    Post subject: Reply with quote

Hi Kolusu,

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
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Tue Nov 15, 2005 4:00 pm    Post subject: Reply with quote

tattva,

your control cards should start from col 2 , you have them in col1. look at the control cards in my post.

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tattva
Beginner


Joined: 02 Feb 2005
Posts: 97
Topics: 36

PostPosted: Tue Nov 15, 2005 4:25 pm    Post subject: Reply with quote

Thanks a lot Kolusu!!!
Back to top
View user's profile Send private message
tattva
Beginner


Joined: 02 Feb 2005
Posts: 97
Topics: 36

PostPosted: Wed Nov 16, 2005 12:20 pm    Post subject: Reply with quote

Hi Kolusu,

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

//CTL1CNTL DD *
OUTFIL FNAMES=M1,
OUTREC=(1,132,132X)
//CTL2CNTL DD *
SORT FIELDS=(21,4,BI,A)
OUTFIL FNAMES=M2,
OUTREC=(1,132,1,132)
//CTL3CNTL DD *
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
/*

Any help in this regard would be greatly appreciated.

Thanks,
Tattva
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Wed Nov 16, 2005 12:26 pm    Post subject: Reply with quote

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.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tattva
Beginner


Joined: 02 Feb 2005
Posts: 97
Topics: 36

PostPosted: Wed Nov 16, 2005 12:43 pm    Post subject: Reply with quote

Hi Kolusu,

Could you please post any links for understanding this ?

Thanks,
Tattva
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group