View previous topic :: View next topic
|
Author |
Message |
salil mahapatra
New User
Joined: 29 Apr 2008 Posts: 2 Location: mumbai
|
|
|
|
Hi All,
I have a vsam file as :
sdate Ddate
20070623 20090606
20060617 20040309
20070501 20050912
with thousands of records...................
1. i need to compare each record of "sdate" and "ddate".
2. if "sdate" < "ddate" ---no change required, file to reamain unchanged.
3. if " sdate > "ddate "-- , then "ddate " has to be replaced with 99999999 and update the file.
It has to be written through a JCL. Could anyone please suggest me the way along with the appropriate syntax. make use of any tool like ICETOOL / rexx also.
thanks
salil |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Salil,
Here's a DFSORT/ICETOOL job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... VSAM file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=... VSAM file
//TOOLIN DD *
COPY FROM(IN) TO(T1) USING(CTL1) VSAMTYPE(F)
COPY FROM(T1) TO(OUT) VSAMTYPE(F)
/*
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=(1,8,CH,GT,26,8,CH),
OVERLAY=(26:C'99999999'))
/*
|
|
|
Back to top |
|
|
salil mahapatra
New User
Joined: 29 Apr 2008 Posts: 2 Location: mumbai
|
|
|
|
//PHS022SS JOB (0PSD0000),'PSDASC01',CLASS=1,MSGCLASS=X
//STEP01 EXEC PGM=ICETOOL
//IN DD DSN=PHS.PHS022.UPCREF.KSDS.DATA10,DISP= (OLD,,DELETE)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=PHS.PHS022.UPCREF.KSDS.FINAL,DISP=(OLD,,DELETE)
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN) TO(T1) USING(CTL1) VSAMTYPE(F)
COPY FROM(T1) TO(OUT) VSAMTYPE(F)
/*
The above jcl is to copy , doesnot throw any errors and runs sucessfully. but the out file doesn't contain any records. Any comments on this. |
|
Back to top |
|
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
What is coded in CTL1? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Were there any (qualified) records on the input file?
If you post CTL1 (as requested) and the informational messages from the execution, someone will be able to help.
When you post jcl and control statements, it is best to use the "Code" tag near the top of the reply panel. It makes the post much more readable. Notice the difference between what Frank posted and your last post. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Salil,
this has nothing to do with the results but why a
DISP=(OLD,,DELETE) ?
If the job abends you will lose both IN & OUT files.
Gerry |
|
Back to top |
|
|
|