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 

Syncsort: Pass a value to Sysin
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
vivek
Beginner


Joined: 15 Jul 2004
Posts: 95
Topics: 11
Location: Edison,NJ

PostPosted: Tue Sep 21, 2004 9:06 am    Post subject: Syncsort: Pass a value to Sysin Reply with quote

I am planning to use sync sort to delete particular records in a file. I would use date as parameter to delete records. If date on a particular row is less than DATEA then do not include the record.

Can I pass the DATEA thru the JCL ? or it should be hard coded in the sysin for the SORT ? if it is impossible I may need to use cobol .

Thanks,
Vivek
_________________
Vivek,NJ

Db2,IDMS
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Sep 21, 2004 9:41 am    Post subject: Reply with quote

Vivek,

You can generate dynamic include/omit cards. Please post the details like LRECL, RECFM & Position of the date field you want to validate.

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


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Tue Sep 21, 2004 9:43 am    Post subject: Reply with quote

Does SYNCSORT support the use of the //SYMNAMES DD?
Back to top
View user's profile Send private message
vivek
Beginner


Joined: 15 Jul 2004
Posts: 95
Topics: 11
Location: Edison,NJ

PostPosted: Tue Sep 21, 2004 9:55 am    Post subject: Reply with quote

Code:

//VIVEKPD JOB CARD
//  STEP 1  EXEC PGM=DAILY1,PARM=M
//INDD DD DSN=INPUT.DATASET,DISP=SHR
//OUTDD DD DSN=OUTPUT.DATASET,DISP=SHR
//*          PARMLIB HAS DATE RANGE FOR PROCESSING
//SYSIN DD DNS=VIVEK.PARMLIB,DISP=SHR
//* NEXT STEP SORT


I want to put the sort in the next step.
The dataset i want to process has record lenght of 80 , fixed. the date is ccyymmdd format.

vivek.parmlib is changed monthly to put the monthly date range for processing the step 1. after step 1 i need to remove all rows with date less than or equal to the highest value in the date range.
Am i clear ?
_________________
Vivek,NJ

Db2,IDMS
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Sep 21, 2004 9:56 am    Post subject: Reply with quote

Superk,

The latest version syncsort for z/OS supports SYMNAMES

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


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

PostPosted: Tue Sep 21, 2004 10:50 am    Post subject: Reply with quote

vivek,

The following JCL will give you the desired results. I assumed that vivek.parmlib has the cut off date in the first 8 bytes.

And the date to be vaildate is in position 10 of the input file. The first copy operator generates a control card as follows which will be used as control card to eliminate the unwanted records.

Code:

 OMIT COND=(10,8,CH,LT,C'20040920')


Code:

//STEP0100 EXEC PGM=SYNCTOOL                                 
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//INDATE   DD *                                             
20040920                                                     
//IN       DD *                                             
REC1     20040910                                           
REC2     20040911                                           
REC3     20040912                                           
REC4     20040920                                           
REC5     20040922                                           
//OUT      DD SYSOUT=*                                       
//TOOLIN   DD *                                             
  COPY FROM(INDATE)      USING(CTL1)                         
  COPY FROM(IN) TO(OUT)  USING(CTL2)                         
//CTL1CNTL DD *                                             
  OUTFIL FNAMES=CTL2CNTL,                                   
  OUTREC=(C' OMIT COND=(10,8,CH,LT,C',  $ OMIT COND=(10,8,CH,LT,C
          C'''',                        $ OPENING QUOTE
          1,8,                          $ DATE FROM PARM
          C'''',                        $ CLOSING QUOTE
          C')',                         $ CLOSING PARENTHESIS
          80:X)                         $ PAD SPACES TO 80 BYTES
//CTL2CNTL DD DSN=&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)   
/*                                                           

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
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Sep 21, 2004 1:17 pm    Post subject: Reply with quote

Vivek,

If you have the latest version of syncsort, then you can use SYMBOLS to eliminate the unwanted records.

In your cobol pgm create 80 byte recfm=fb file for symbols as follows.

Code:

VALIDATE,C'ccyymmdd'


Now you can use it directly in your sort step

Code:

//STEP0100 EXEC PGM=SORT         
//SYSOUT   DD SYSOUT=*           
//SYMNAMES DD *                 
VALIDATE,C'20040920'             
//SORTIN   DD *                         
REC1     20040910                       
REC2     20040911                       
REC3     20040912                       
REC4     20040920                       
REC5     20040922                       
//SORTOUT  DD SYSOUT=*                   
//SYSIN    DD *                         
  SORT FIELDS=COPY                       
  OMIT COND=(10,8,CH,LT,VALIDATE)       
/*                                       


During execuetion the validate symbol gets substituted.

Code:

 SORT FIELDS=COPY                       
 OMIT COND=(10,8,CH,LT,C'20040920')     


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
vivek
Beginner


Joined: 15 Jul 2004
Posts: 95
Topics: 11
Location: Edison,NJ

PostPosted: Tue Sep 21, 2004 1:41 pm    Post subject: Reply with quote

Quote:

//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
VALIDATE,C'20040920'
//SORTIN DD *
REC1 20040910
REC2 20040911
REC3 20040912
REC4 20040920
REC5 20040922
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OMIT COND=(10,8,CH,LT,VALIDATE)


Instead of having a string '20040920' after validate , is there anyway to send value from previous parmlib ?

//SYMNAMES DD *
VALIDATE,C'20040920'


I am not comfortable with synctool since I don't have manuals with me. Is synctool part of syncsort ? I am not even sure if I have synctool in my shop
from a previous parmlib dataset ?
_________________
Vivek,NJ

Db2,IDMS
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
vivek
Beginner


Joined: 15 Jul 2004
Posts: 95
Topics: 11
Location: Edison,NJ

PostPosted: Tue Sep 21, 2004 1:47 pm    Post subject: Reply with quote

Quote:

C'''', $ OPENING QUOTE
1,8, $ DATE FROM PARM
C'''',


Kolusu why four quotes for opening and closing

C', $ OPENING QUOTE
1,8, $ DATE FROM PARM
C',
isnt the above enough ?
_________________
Vivek,NJ

Db2,IDMS
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
vivek
Beginner


Joined: 15 Jul 2004
Posts: 95
Topics: 11
Location: Edison,NJ

PostPosted: Tue Sep 21, 2004 2:06 pm    Post subject: Reply with quote

SYNCSORT 3.7DN TPF3A US PATENTS: 4210961,5117495, OTHER PAT. PEND. (C) 1998 S
z/OS 1.2.0 CPU MODEL 9672

i see syncsort version is 3.7dn is this the latest ?
_________________
Vivek,NJ

Db2,IDMS
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Sep 21, 2004 2:39 pm    Post subject: Reply with quote

Vivek,

Quote:

Instead of having a string '20040920' after validate , is there anyway to send value from previous parmlib ?


When you are updating your parmlib with date range, you can create another parm for SYMNAMES dataset. or we can use the same parmlib if it is only used for the filteration of data.

Quote:

I am not comfortable with synctool since I don't have manuals with me. Is synctool part of syncsort ? I am not even sure if I have synctool in my shop


Synctool is a part of syncsort, but it is an undocumented/unsupported feature of synctool. If you are skeptical about its usage you can split my job into 2 steps using traditional sort.

Code:

//STEP0100 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DSN=YOUR PARMLIB MEMBER,
//            DISP=SHR                   
//SORTOUT  DD DSN=&T,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
//SYSIN    DD *                                       
  SORT FIELDS=COPY                                       
  OUTREC FIELDS=(C' OMIT COND=(10,8,CH,LT,C',           
                 C'''',                                 
                 1,8,                                   
                 C'''',                                 
                 C')',                                   
                 80:X) 
//*                                 
//STEP0200 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                         
REC1     20040910                                       
REC2     20040911                                       
REC3     20040912                                       
REC4     20040920                                       
REC5     20040922                                       
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                       
  SORT FIELDS=COPY                                       
//         DD DSN=&T,DISP=OLD                           
/*


Another way of doing using symbols:

Code:

//STEP0100 EXEC PGM=SORT     
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=YOUR PARMLIB MEMBER,
//            DISP=SHR                   
//SORTOUT  DD DSN=&S,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
//SYSIN    DD *                                     
  SORT FIELDS=COPY                                     
  OUTREC FIELDS=(C'VALIDATE',C',''',01,8,C'''',80:X)   
/*                                                     
//STEP0200 EXEC PGM=SORT                   
//SYSOUT   DD SYSOUT=*                     
//SYMNAMES DD DSN=&S,DISP=OLD             
//SORTIN   DD *                           
REC1     20040910                         
REC2     20040911                         
REC3     20040912                         
REC4     20040920                         
REC5     20040922                         
//SORTOUT  DD SYSOUT=*                     
//SYSIN    DD *                           
  SORT FIELDS=COPY                         
  OMIT COND=(10,8,CH,LT,VALIDATE)         
/*     


Quote:

Kolusu why four quotes for opening and closing


We are dynamically generating the control cards. We need to put quotes around the date field. so we need to generate the quote ' dynamically. So we enclosed in quotes so that we can quote as a character.

Quote:

i see syncsort version is 3.7dn is this the latest ?


You don't have the latest version of syncsort. The latest version of syncsort is SYNCSORT FOR Z/OS 1.2


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
vivek
Beginner


Joined: 15 Jul 2004
Posts: 95
Topics: 11
Location: Edison,NJ

PostPosted: Wed Sep 22, 2004 1:11 pm    Post subject: Reply with quote

I need some help for daily processing.

Input file
case number- 4 char
date - ccyymmdd
reason - 4 char

file example
1234200406040503
2345200406040503
1234200406040503

For daily processing, I want to process the records with current date.
How can I do it in a sort step. My date is in ccyymmdd format.


My daily JCL would be

1. Eliminate records which were not created today. Also eliminate duplicates.
_________________
Vivek,NJ

Db2,IDMS
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
vivek
Beginner


Joined: 15 Jul 2004
Posts: 95
Topics: 11
Location: Edison,NJ

PostPosted: Wed Sep 22, 2004 1:12 pm    Post subject: Reply with quote

Quote:

My daily JCL would be

1. Eliminate records which were not created today. Also eliminate duplicates.


Sorry previous post was incomplete.

2. Run the cobol program for daily processing.
_________________
Vivek,NJ

Db2,IDMS
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Sep 22, 2004 1:24 pm    Post subject: Reply with quote

vivek,

Quote:

1. Eliminate records which were not created today. Also eliminate duplicates.


The following JCl will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT                 
//SYSOUT    DD SYSOUT=*                 
//SORTIN    DD *                         
1234200406040503                         
2345200406040503                         
1234200406040503                         
1234200409220503                         
1234200409220503                         
//SORTOUT   DD DSN=YOUR OUTPUT FILE,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(CYL,(X,Y),RLSE)
//SYSIN     DD *                         
  INCLUDE COND=(5,8,CH,EQ,DATE1)    $ TODAY'S RECORDS     
  SORT FIELDS=(1,16,CH,A)           $ SORT ON CASE #, DATE, REAS             
  SUM FIELDS=NONE                   $ ELIMINATE DUPES
/*   


The output from this step will be input to your cobol program

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
vivek
Beginner


Joined: 15 Jul 2004
Posts: 95
Topics: 11
Location: Edison,NJ

PostPosted: Wed Sep 22, 2004 3:37 pm    Post subject: am i missing something ? Reply with quote

Kolusu,

i get this error in clude statement at the DATE1 parameter. since mine is not a Z/OS version of SORT , is this causing the problem.

what would be alternate ?

SYNCSORT 3.7DN TPF3A US PATENTS: 4210961,5117495, OTHER PAT. PEND. (C) 1998 S
z/OS 1.2.0 CPU MODEL 9672
SYSIN :
INREC FIELDS=(1,80)
OUTREC FIELDS=(1,80)
SORT FIELDS=COPY
INCLUDE COND=(14,8,CH,EQ,DATE1)
*
SUM FIELDS=NONE
WER038I WARNING: SYNCSORT MVS IS NOT CERTIFIED TO RUN ON Z/OS. CONTACT SYNCSOR
WER268A INCLUDE STATEMENT : SYNTAX ERROR
******************************** BOTTOM OF DATA ********************************

thanks,
Vivek
_________________
Vivek,NJ

Db2,IDMS
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities 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