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

Comparing CCYYMMDD with YYMMDD..


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

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Wed Feb 29, 2012 3:46 pm
Reply with quote

Hi,

I have two files.

File 1: FB/80 Sequential file
This file contains date in MM/DD/CCYY format in the position 48.

File 2: VSAM KSDS VB
This file contains date in YYMMDD format in the position 13.

I need to pull records from VSAM when the date in VSAM file is greater than the date in file1.

So i used symnames. In step1 i converted MM/DD/CCYY format to CCYYMMDD format. In step2 i am comparing YYMMDD date from vsam file with CCYYMMDD build from symnames.

Code:

//STEP010  EXEC PGM=ICEMAN                                         
//SYSPRINT DD SYSOUT=*                                             
//SORTIN   DD DISP=SHR,DSN=TEST.DATEFILE                         
/*                                                                 
//SORTOUT  DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)   
//SYSOUT   DD SYSOUT=*                                             
//SYSIN    DD *                                                   
  OPTION COPY                                                     
  OUTREC FIELDS=(C'TARG,',54,4,48,2,51,2,80:X)                     
/*                                                                 
//S2       EXEC PGM=ICEMAN                                         
//SYSOUT   DD SYSOUT=*                                             
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)                             
//SORTIN   DD DISP=SHR,DSN=TEST.VSAM.KSDS               
/*                                                       
//SORTOUT  DD DSN=TEST.RK.X.CDE.EXTRACT,       
//             DISP=(NEW,CATLG,DELETE),                   
//             UNIT=SYSDA,                               
//             SPACE=(CYL,(10,05),RLSE),                 
//             DCB=(RECFM=V,LRECL=1476,BLKSIZE=0)         
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                       
  INCLUDE COND=(17,6,Y2T,GT,TARG)                         
/*                                                   


But i am getting the following error in step2.

Code:

ICE270I 0 PROCESSING SYMNAMES STATEMENTS                                       
ICE280I 1 ORIGINAL STATEMENTS FROM SYSIN    FOLLOW                             
            SORT FIELDS=COPY                                                   
            INCLUDE COND=(17,6,Y2T,GT,TARG)                                     
ICE282I 0 PERFORMING SYMBOL SUBSTITUTION AS NEEDED                             
ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                                 
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 05:05 ON WED FE
           SORT FIELDS=COPY                                                     
           INCLUDE COND=(17,6,Y2T,GT,20111129)                                 
ICE201I H RECORD TYPE IS V - DATA STARTS IN POSITION 5                         
ICE221A 0 INVALID FIELD OR CONSTANT IN *INCLUDE IFTHEN 0 CONDITION 1           
ICE751I 0 C5-K90025 C6-K90025 C7-K54603 C8-K62201 EE-K51707 E7-K62201           
ICE052I 3 END OF DFSORT                                                         


Kindly help me to resolve this.

Thanks
R KARTHIK
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Wed Feb 29, 2012 4:31 pm
Reply with quote

I want to add another detail.

While converting YYMMDD to CCYYMMDD,
if the YY > 50, then
i need to move 19 to CC
else 20 to CC.

Thanks
R KARTHIK
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Feb 29, 2012 7:20 pm
Reply with quote

Is it because you are comparing 6 bytes to an 8-byte constant?
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Wed Feb 29, 2012 7:28 pm
Reply with quote

Ya thats what i need. How to convert YYMMDD from VSAM file to CCYYMMDD with the condition i gave so that i will be able to compare.

if the YY > 50, then
i need to move 19 to CC
else 20 to CC.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Feb 29, 2012 7:31 pm
Reply with quote

looks like you will have to do a little inrec build (create 8 char date at end of record)
and then put the INCLUDE in outfile with a build to drop the extra 8 char.
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Wed Feb 29, 2012 8:06 pm
Reply with quote

Hey thanks for the reply.

I will try that.

Meanwhile if anyone have sample code to acheive this it will be great.

Thanks
RKARTHIK
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Wed Feb 29, 2012 9:08 pm
Reply with quote

karthikr44,

Read about Y2PAST.

Thanks,
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Feb 29, 2012 10:16 pm
Reply with quote

karthikr44,

You need to use Y Constant(Y'yyxxxx') format along with Y2PAST . Use the following DFSORT JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=ICEMAN                                         
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DISP=SHR,DSN=TEST.DATEFILE
/*                                                                 
//SORTOUT  DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,0)),DISP=(,PASS)
//SYSIN    DD *                                         
  OPTION COPY,STOPAFT=1                                 
  OUTREC FIELDS=(C'TARG,Y''',56,2,48,2,51,2,C'''',80:X) 
/*         
//STEP0200 EXEC PGM=ICEMAN       
//SYSOUT   DD SYSOUT=*         
//SYMNAMES DD DSN=&&S1,DISP=SHR
//SORTIN   DD DISP=SHR,DSN=TEST.VSAM.KSDS               
/*                                                       
//SORTOUT  DD DSN=TEST.RK.X.CDE.EXTRACT,       
//             DISP=(NEW,CATLG,DELETE),                   
//             UNIT=SYSDA,                               
//             SPACE=(CYL,(10,05),RLSE)
//SYSIN    DD *
//SYSIN    DD *                     
  OPTION COPY,Y2PAST=1950           
  RECORD TYPE=V                     
  INCLUDE COND=(17,6,Y2T,GT,TARG)     
/*


Check this link for more information

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1ca60/3.7.12?
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Comparing Header and Trailer. DFSORT/ICETOOL 7
No new posts Compare input date as YYMMDD with the... SYNCSORT 5
No new posts Comparing Signed Packed decimal and p... SYNCSORT 2
No new posts Comparing Comp-3 fields with greater ... DFSORT/ICETOOL 11
Search our Forums:

Back to Top