Need to copy VSAM file using SORT



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Need to copy VSAM file using SORT

Postby b.praveen » Sun Jul 06, 2008 6:48 pm

I have a requirement like, I need to Copy data from VSAM file to seq file for the data Current date - 60 days. and sort that seq file based on item number.
Item number and current date are fields in the vsam file. I need to write this in JCL(No COBOL, no DB2 Query). The JCL runs weekly.

How can I write this condition using sort? Please help me
b.praveen
 
Posts: 3
Joined: Sun Jul 06, 2008 6:25 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need to copy VSAM file using SORT

 

Re: Need to copy VSAM file using SORT

Postby dick scherrer » Sun Jul 06, 2008 10:04 pm

Hellp b.praveen and welcome to the forums,

Which sort product/release is used on your system? If you do not know, run any sort and post the spooled output from the sort - this will show which sort and which release of that sort product that you are using.

What have you tried so far? You should post some sample input, desired sample output from that input and the "processing rules" as well as what you have coded to accomplish this. You should also mention the lrecls of the files.

Scheduling should be dealt with your scheduling people.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Need to copy VSAM file using SORT

Postby b.praveen » Mon Jul 07, 2008 5:20 am

Sample input
item# Retail Date
10004 20080401
10005 20080501
10006 20080601
10007 20080701

Output should be retail date = current date - 60 days

item# Retail Date
10006 20080601
10007 20080701

This is the sample code I used for retail date = current date
//SRT1 EXEC PGM=SORT
//SORTOUT DD DISP=(,CATLG,DELETE),DSN=TEST.DIST.SOURCED.D1009,
// UNIT=(3390,3),SPACE=(TRK,(10,100),RLSE),
// RECFM=FB,LRECL=157
//SORTIN DD DISP=SHR,DSN=DC.DIST.SOURCED.DALYBKUP.G2346V00
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(66,4,PD,EQ,'20080706')
/*
b.praveen
 
Posts: 3
Joined: Sun Jul 06, 2008 6:25 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need to copy VSAM file using SORT

Postby dick scherrer » Mon Jul 07, 2008 6:39 am

Hello,

So Far , so good :)

Now, from earlier, please provide:
Which sort product/release is used on your system? If you do not know, run any sort and post the spooled output from the sort - this will show which sort and which release of that sort product that you are using.
This matters because DFSORT topics and Syncsort topics are handled in different parts of the forum.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Need to copy VSAM file using SORT

Postby b.praveen » Thu Jul 10, 2008 9:05 pm

Sorry for the late reply, I was out of office, Today I ran SORT step to find the version number.
This is the version of SORT utility we are using in our company 'SYNCSORT FOR Z/OS 1.2.2.1R'
b.praveen
 
Posts: 3
Joined: Sun Jul 06, 2008 6:25 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need to copy VSAM file using SORT

Postby Alissa Margulies » Mon Jul 21, 2008 8:51 pm

b.praveen wrote:Copy data from VSAM file to seq file for the data Current date - 60 days. and sort that seq file based on item number.

Based solely on your sample input data, if you have access to SyncSort for z/OS 1.3, you can code the following:

//SYSIN DD *                       
    SORT FIELDS=(1,5,CH,A)             
    INCLUDE COND=(7,8,CH,GE,&DATE1-60)
/*   

This will obviously need to be modified to correspond to your actual data fields.
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post