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

Get only year from the current date using syncsort outrec


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

New User


Joined: 24 Nov 2008
Posts: 17
Location: USA

PostPosted: Wed Dec 10, 2008 1:27 pm
Reply with quote

How to get only year from the current date using syncsort outrec?
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Wed Dec 10, 2008 2:01 pm
Reply with quote

HI,

U can use INCLUDE COND for that.

If ur date is character string use below
&DATE1 - C'yyyymmdd'
&DATE2 - C'yyyymm'

If ur date is numeric string use below
&DATE1P - C'yyyymmdd'
&DATE2P - C'yyyymm'

Sort card:
INCLUDE COND=(5,8,ZD,EQ,&DATE1P)

Regards
R KARTHIK
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Dec 10, 2008 2:35 pm
Reply with quote

karthikr44,

I think the TS was asking for generating the current year from the current-date functions in Syncsort and not comparing a date field witth current-date.

joseph murphy
,

The below jcl might help. If this doesn't match your requirement, please explain further with examples.
Code:
//STEP1    EXEC PGM=SORT     
//SORTIN   DD *             
DUMMY RECORD                 
//SYSOUT   DD SYSOUT=*       
//SORTOUT  DD SYSOUT=*       
//SYSIN    DD *             
  OPTION COPY               
  INREC OVERLAY=(&DATE2,5:8X)


SORTOUT
Code:
2008
Back to top
View user's profile Send private message
joseph murphy

New User


Joined: 24 Nov 2008
Posts: 17
Location: USA

PostPosted: Wed Dec 10, 2008 2:51 pm
Reply with quote

Thanks for your explanation,

1.from 1-4 positions i need to display year
2.from 15-16 month
3.from 20-21 date

how to display.

In query i have like,

substr(char(curent_date),1,4)
substr(char(curent_date),5,2)
substr(char(curent_date),7,2)

using syncsort outrec?
Back to top
View user's profile Send private message
joseph murphy

New User


Joined: 24 Nov 2008
Posts: 17
Location: USA

PostPosted: Wed Dec 10, 2008 3:30 pm
Reply with quote

arcvns you understood my qustion correctly,But i should not use overlay,i need to use outrec

I have sql query like,

substr(char(current_date),1,4)
substr(char(current_date),6,2)
substr(char(current_date),9,2)

I am converting this query using syncsort,

So,In outrec,I have to display like this,

from the current date,

1.1-4 positions year,
2.5-6 month
3.7-8 date

please help me out,
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Dec 11, 2008 12:50 am
Reply with quote

Hello,

Quote:
But i should not use overlay,i need to use outrec
Why not? Is there some business reason for this?
Back to top
View user's profile Send private message
joseph murphy

New User


Joined: 24 Nov 2008
Posts: 17
Location: USA

PostPosted: Fri Dec 12, 2008 12:01 pm
Reply with quote

Hi all,

I am doing performance tuening for SQL quries using syncsort,i have CASE like this,
COLEASCE(
SUBSTR(
CASE(WHEN ZONE_ID IS NULL
THEN '00000000'
ELSE DIGITS(ZONE_ID)
END)1,8)
SUBSTR('00000000'))
Note:-
ZONE_ID is a Decimal(8,0),PD format

I have to do formatting in syncsort outrec,how to do it?
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