View previous topic :: View next topic
|
Author |
Message |
Absinthia
New User
Joined: 10 Jan 2008 Posts: 36 Location: CHINA
|
|
|
|
I have two files A and B.
A has only one record.the key field is date from position 8 to 17
Code: |
----+----1----+----2----+----3----+----4----+--
*****************************
affdfdffdfdfdf2008-03-01abcddfee
******************************* |
B has many records. the key field is from positon 1.
Code: |
----+----1----+----2----+----3
*****************************
2007-10-04fa34124fadsf
2008-02-05fa44312fadsf
2008-01-08fad34132adsf
2008-02-15fa3241234fadff
2008-08-11fad41dsfadsf
2008-05-01fa341234adsf
2008-05-03fadeqwefadsf
2008-06-04fad34df234324
2008-03-07fae33455545f
2008-08-07faf34dsfadsf
2008-05-18fad3423434sf |
I want to extract the records from B whose date field is greater than A.
Thanks in advance. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
What are the record lengths and formats (Fix or Variable) of the two files? |
|
Back to top |
|
|
Absinthia
New User
Joined: 10 Jan 2008 Posts: 36 Location: CHINA
|
|
|
|
the records of both files are LRECL=80,RECFM=FB
Craq Giegerich wrote: |
What are the record lengths and formats (Fix or Variable) of the two files? |
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
In your example, the date field in file1 doesn't appear to start in position 8, but assuming it actually does, you can use a DFSORT job like the following to do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD * input file1
adfdfdf2008-03-01abcddfee
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
INREC BUILD=(C'TDATE,''',8,10,C'''',80:X)
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD * input file2
2007-10-04fa34124fadsf
2008-02-05fa44312fadsf
2008-01-08fad34132adsf
2008-02-15fa3241234fadff
2008-08-11fad41dsfadsf
2008-05-01fa341234adsf
2008-05-03fadeqwefadsf
2008-06-04fad34df234324
2008-03-07fae33455545f
2008-08-07faf34dsfadsf
2008-05-18fad3423434sf
/*
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,10,CH,GT,TDATE)
/*
|
|
|
Back to top |
|
|
Absinthia
New User
Joined: 10 Jan 2008 Posts: 36 Location: CHINA
|
|
|
|
Frank Yaeger,
thanks a lot,it works. |
|
Back to top |
|
|
harishch_ch
New User
Joined: 07 Jan 2008 Posts: 27 Location: bangalore
|
|
|
|
I am receiving Syntax error for INREC statement,
can some one solve it? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
no, sorry. The 'guess what this means' department is closed for today!
ask again tomorrow, and be sure to post your question to existing topics to as to confuse forum members and insure that you only get flammed and receive little or no answers to your open-ended, ambiguous, non-sensical questions. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
I am receiving Syntax error for INREC statement, |
Harish,
Is that for the INREC statement shown in THIS thread or for some totally different INREC statement?
You need to show the job and control statements you used, and the DFSORT messages you received in //SYSOUT before anyone can have a clue to what you're talking about. We can't read your mind or look over your shoulder. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
harishch_ch wrote: |
I am receiving Syntax error for INREC statement,
|
I would guess You are not using DFSORT and even if SyncSort then release 1.3 definitions are not availble at Your shop. Support for symname symbolics was included in SyncSort for z/OS 1.3.
Please check the SYSOUT of recently submitted SORT JOB, if You get ICEXXX messages, you are using DFSORT & if messages are of type WERXXX, you are using SyncSort. |
|
Back to top |
|
|
|