Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
compare 2 date fields of a VSAM file using ICETOOL / REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: compare 2 date fields of a VSAM file using ICETOOL / REXX
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 Moderator


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

PostPosted: Tue May 27, 2008 8:51 pm    Post subject:
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    Post subject:
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    Post subject:
Reply with quote

What is coded in CTL1?
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Wed Jun 04, 2008 11:38 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Thu Jun 05, 2008 4:16 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Looping REXX - unable to interrupt RAVISANKAR07 CLIST & REXX 3 Wed Dec 06, 2017 1:08 pm
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us