View previous topic :: View next topic
|
Author |
Message |
ABaluchamy
New User
Joined: 29 Dec 2006 Posts: 34 Location: INDIA
|
|
|
|
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 |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
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 |
|
|
ABaluchamy
New User
Joined: 29 Dec 2006 Posts: 34 Location: INDIA
|
|
|
|
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 |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
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 |
|
|
ABaluchamy
New User
Joined: 29 Dec 2006 Posts: 34 Location: INDIA
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
ABaluchamy
New User
Joined: 29 Dec 2006 Posts: 34 Location: INDIA
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
ABaluchamy
New User
Joined: 29 Dec 2006 Posts: 34 Location: INDIA
|
|
|
|
Hi Frank,
Thanks... Its working!!!! |
|
Back to top |
|
|
|