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

compare 2 date fields of a VSAM file using ICETOOL / REXX


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
salil mahapatra

New User


Joined: 29 Apr 2008
Posts: 2
Location: mumbai

PostPosted: Tue May 27, 2008 3:36 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue May 27, 2008 8:51 pm
Reply with quote

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
View user's profile Send private message
salil mahapatra

New User


Joined: 29 Apr 2008
Posts: 2
Location: mumbai

PostPosted: Wed Jun 04, 2008 8:13 pm
Reply with quote

//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
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Wed Jun 04, 2008 8:47 pm
Reply with quote

What is coded in CTL1?
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: Wed Jun 04, 2008 11:38 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Jun 05, 2008 4:16 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
Search our Forums:

Back to Top