View previous topic :: View next topic
|
Author |
Message |
nartcr
New User
Joined: 06 Jun 2007 Posts: 83 Location: anada
|
|
|
|
Hello,
I see that this topic have been discussed many times, but it confuses me now.
Here is what i am trying to achieve:
Code: |
//*** SYNCSORT STARTS HERE
//EXTREC EXEC PGM=SORT
//SORTMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//* 400 byte input KSDS file
//SORTIN DD DISP=SHR,DSN=EBAC.POMSB.VTS.RSNDREQ.F505
//SORTOUT DD DISP=(,CATLG,DELETE),
// DSN=EBAC.POMSB.VTS.RSNDREQ.F505.SORT1,
// UNIT=SYSDA,
// SPACE=(CYL,(1,1),RLSE),RECFM=FB
//SYSIN DD *
INCLUDE COND=(62,8,CH,EQ,&DATE1)
SORT FIELDS=COPY
/* |
from position 62-70, VSAM contains date field with following datatype
WS-DATE 9(8). A sample value would be '20110116'.
I see in other forums, that DATE1 would give in the format YY-MM-DD, but my documentation ( ver 1.1 ) says DATE1 would yield in the format c'YYYYMMDD'.
In my shop, I'm using ver 1.3.2. |
|
Back to top |
|
|
nartcr
New User
Joined: 06 Jun 2007 Posts: 83 Location: anada
|
|
|
|
When i run this JCL, it doesnt extract any records. Any help or insight is appreciated. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
That's what my documentation shows as well, and it works for me. Maybe your offset is off? |
|
Back to top |
|
|
nartcr
New User
Joined: 06 Jun 2007 Posts: 83 Location: anada
|
|
|
|
I rechecked the offset position, and it looks good.
I counted the offset in copybook variable. Here is the File Aid view ( mapped to copybook )
EBACF505-DATE
8/NUM
(62-69)
12-----------
*************
20120116
From documentation:
Parameter Output Length (Bytes)
&DATE C'mm/dd/yy' 8
&DATE1 C'yyyymmdd' 8
&DATE1(c) C'yyyycmmcdd' 10
What am i doing wrong here? VSAM file is declared FB,400. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If you have min and max record-length values on your KSDS, your Sort probably expects you to treat it as a vaiable-length record, ie you need to allow for an "RDW".
If you run something like this, you can confirm to yoursefl the value in DATE1 (or whatever).
Code: |
//DATESRT EXEC PGM=SORT
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(10:DATE1)
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SORTIN DD *
TEST DATE
|
Edit: Crossed your last in the "post".
Use sort to read the VSAM, stopping after a small number of records. BUILD an output file (Sysout is fine) with the key and the date.
Can you post all the output messages from the sort?
If all looks OK, go home, it'll be something obvious in the morning. |
|
Back to top |
|
|
nartcr
New User
Joined: 06 Jun 2007 Posts: 83 Location: anada
|
|
|
|
I think I have overlooked my question. I should have displayed the date from DATE1 and checked it. I didnt know how to do this - thanks a lot for showing it. Its my mistake.
I can take some nap now. Once again thanks a bunch. |
|
Back to top |
|
|
|