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

Compare a set of 10 RECORDS with a standard date file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ABaluchamy

New User


Joined: 29 Dec 2006
Posts: 34
Location: INDIA

PostPosted: Thu Apr 12, 2007 4:30 pm
Reply with quote

I need to compare a set of 10 RECORDS with a standard date file's record. If any of the record matches with the standard date file's record then i need to write the matched file's record as a output file. All this has to be done using JCL sort.

Eg: standard file has the following record
XX/XX/XXYY/YY/YYZZ/ZZ/ZZ

FILE1:
000000AA/AA/AA......
000000BB/BB/BB
000000XX/XX/XX000000000
000000CC/CC/CC0000
000000XX/XX/XX0000


Here the record no.3 and 5 should be written in a separate file.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Apr 12, 2007 4:34 pm
Reply with quote

Hi Anand,

Ur question is not clear

Is following is the one record of the std file

Quote:
XX/XX/XXYY/YY/YYZZ/ZZ/ZZ
Back to top
View user's profile Send private message
ABaluchamy

New User


Joined: 29 Dec 2006
Posts: 34
Location: INDIA

PostPosted: Thu Apr 12, 2007 4:42 pm
Reply with quote

Guptae,

Yes.. my standard file has only 1 record contains more than one date.. The position of current date is known (1,8).
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Apr 12, 2007 4:57 pm
Reply with quote

Hi There,

Code:
SORT FIELDS=COPY                   
INCLUDE COND=(7,8,CH,EQ,C'XX/XX/XX')


Hope it helps mean while i am trying for more efficent solution
Back to top
View user's profile Send private message
ABaluchamy

New User


Joined: 29 Dec 2006
Posts: 34
Location: INDIA

PostPosted: Thu Apr 12, 2007 5:01 pm
Reply with quote

i ve tried it.. but, 'XX/XX/XX' should not be hard coded in include condition. It should be refered from standard date file.
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: Thu Apr 12, 2007 8:58 pm
Reply with quote

Anand,

You show three dates in your date record:

XX/XX/XXYY/YY/YYZZ/ZZ/ZZ

But you only have the first date in your input records. Do you only want to INCLUDE records with the first date, or do you want to INCLUDE records with any of the three dates? If the latter, are there always three dates or can there be more or less dates? You need to do a better job of explaining what you want to do and particularly what the date record can contain.
Back to top
View user's profile Send private message
ABaluchamy

New User


Joined: 29 Dec 2006
Posts: 34
Location: INDIA

PostPosted: Fri Apr 13, 2007 10:04 am
Reply with quote

Frank,

The date file contains three records and there no change in number of dates, but the all the three getting updated. All I want to do is compare the first date in Input file from the Date file and put the matched date from Input record in to out file. i dont want to include all the three date from date file.

Thanks,
Anand
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: Fri Apr 13, 2007 9:00 pm
Reply with quote

Here's a DFSORT job that will do what you asked for.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  date file
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
* Create DFSORT Symbol as:
* TARGET,'date'
  INREC BUILD=(C'TARGET,''',1,8,C'''',80:X)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...   input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
* Use TARGET symbol to include records with date.
  INCLUDE COND=(7,8,CH,EQ,TARGET)
/*
Back to top
View user's profile Send private message
ABaluchamy

New User


Joined: 29 Dec 2006
Posts: 34
Location: INDIA

PostPosted: Mon Apr 16, 2007 11:15 am
Reply with quote

Hi Frank,

Thanks... Its working!!!!
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top