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
 
Comparing CCYYMMDD with YYMMDD..

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Comparing CCYYMMDD with YYMMDD..
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    Post subject: Reply to: Comparing CCYYMMDD with YYMMDD..
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Feb 29, 2012 7:20 pm    Post subject: Reply to: Comparing CCYYMMDD with YYMMDD..
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    Post subject: Reply to: Comparing CCYYMMDD with YYMMDD..
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: 6968
Location: porcelain throne

PostPosted: Wed Feb 29, 2012 7:31 pm    Post subject:
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    Post subject: Reply to: Comparing CCYYMMDD with YYMMDD..
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: 578
Location: USA

PostPosted: Wed Feb 29, 2012 9:08 pm    Post subject:
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    Post subject: Reply to: Comparing CCYYMMDD with YYMMDD..
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

http://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    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 How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts comparing comp-3 and unpacked numbers juares castro COBOL Programming 3 Mon May 30, 2016 6:46 pm
No new posts Need help on comparing hexadecimal va... ashok_uddaraju DFSORT/ICETOOL 4 Thu Apr 28, 2016 2:08 am

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