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 a set of 10 RECORDS with a standard date file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Compare a set of 10 RECORDS with a standard date file
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: 1187
Location: Bangalore,India

PostPosted: Thu Apr 12, 2007 4:34 pm    Post subject:
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    Post subject: Re: How to write Sort
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: 1187
Location: Bangalore,India

PostPosted: Thu Apr 12, 2007 4:57 pm    Post subject:
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    Post subject: Re: How to write Sort
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 Moderator


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

PostPosted: Thu Apr 12, 2007 8:58 pm    Post subject:
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    Post subject: Re: Compare a set of 10 RECORDS with a standard date file
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 Moderator


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

PostPosted: Fri Apr 13, 2007 9:00 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 0 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm

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