IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need to copy records from vsam file to seq file using sort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
PKB

New User


Joined: 06 Jul 2008
Posts: 10
Location: hyd

PostPosted: Mon Jul 07, 2008 5:22 am
Reply with quote

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

We use SORT usually, but I have no idea about the version, Can i use the date logic in the sort step?
the current date format is CCYYMMDD.


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')
/*
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jul 07, 2008 7:03 am
Reply with quote

Please do not post in both forums.

Please provide the requested in your original topic.

This topic is locked.

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top