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

Passing Current Date Parm to Syncsort


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

New User


Joined: 06 Jun 2007
Posts: 83
Location: anada

PostPosted: Tue Jan 17, 2012 9:39 pm
Reply with quote

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
View user's profile Send private message
nartcr

New User


Joined: 06 Jun 2007
Posts: 83
Location: anada

PostPosted: Tue Jan 17, 2012 10:07 pm
Reply with quote

When i run this JCL, it doesnt extract any records. Any help or insight is appreciated.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Jan 17, 2012 10:14 pm
Reply with quote

That's what my documentation shows as well, and it works for me. Maybe your offset is off?
Back to top
View user's profile Send private message
nartcr

New User


Joined: 06 Jun 2007
Posts: 83
Location: anada

PostPosted: Tue Jan 17, 2012 10:36 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jan 17, 2012 10:39 pm
Reply with quote

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
View user's profile Send private message
nartcr

New User


Joined: 06 Jun 2007
Posts: 83
Location: anada

PostPosted: Tue Jan 17, 2012 11:00 pm
Reply with quote

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
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top