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
 
Passing Current Date Parm to Syncsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
nartcr

New User


Joined: 06 Jun 2007
Posts: 78
Location: anada

PostPosted: Tue Jan 17, 2012 9:39 pm    Post subject: Passing Current Date Parm to Syncsort
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: 78
Location: anada

PostPosted: Tue Jan 17, 2012 10:07 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Tue Jan 17, 2012 10:14 pm    Post subject: Reply to: Passing Current Date Parm to Syncsort
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: 78
Location: anada

PostPosted: Tue Jan 17, 2012 10:36 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Jan 17, 2012 10:39 pm    Post subject: Reply to: Passing Current Date Parm to Syncsort
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: 78
Location: anada

PostPosted: Tue Jan 17, 2012 11:00 pm    Post subject:
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    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 Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 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

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