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
 
REAL TIME DATA MANIPULATION

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
techslam

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Mon Dec 01, 2014 6:51 pm    Post subject: REAL TIME DATA MANIPULATION
Reply with quote

Hi,
I have below SQL in my sort input file -

Code:

SELECT *
FROM XYZ.TABLE1
WHERE EFFECTIVE_DATE = 'DD.MM.YYYY'
AND END_DATE = 'DD.MM.YYYY'


I want to run a SYNCSORT job and get an output file with date changed to previous months day 1 as shown below

Code:

SELECT *
FROM XYZ.TABLE1
WHERE EFFECTIVE_DATE = '01.11.2014'
AND END_DATE = '30.11.2014'


Can someone pleae help me with this.

Thanks for all the help.
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1542
Location: Andromeda Galaxy

PostPosted: Tue Dec 02, 2014 11:44 am    Post subject:
Reply with quote

Check on SYMNAMES
Back to top
View user's profile Send private message
JAYACHANDRAN THAMPY

New User


Joined: 06 Jun 2006
Posts: 8

PostPosted: Thu Dec 04, 2014 7:51 pm    Post subject: Reply to: REAL TIME DATA MANIPULATION
Reply with quote

Which version of Syncsort you are using?. If you are using Syncsort v1.4, you can try the below JCL. Apart from sort, you can use simple Rexx,Filemanager etc to achieve the same.

Code:
//STEP010  EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD *                                                 
SELECT *                                                         
FROM XYZ.TABLE1                                                 
WHERE EFFECTIVE_DATE = 'DD.MM.YYYY'                             
AND END_DATE = 'DD.MM.YYYY'                                     
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                 
 SORT FIELDS=COPY                                               
 INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:DATE(DM4.),81:C'01',       
                81:DATEADD=(81,10,DT=(DM4.),-1,DAY),             
                91:C'01',93:83,8,101:SEQNUM,1,ZD)),             
       IFTHEN=(WHEN=(101,1,ZD,EQ,3),OVERLAY=(25:91,10)),         
       IFTHEN=(WHEN=(101,1,ZD,EQ,4),OVERLAY=(17:81,10))         
OUTFIL BUILD=(1,80)   


Output:

Code:
SELECT *                                           
FROM XYZ.TABLE1                                     
WHERE EFFECTIVE_DATE = '01.11.2014'                 
AND END_DATE = '30.11.2014'                         
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Dec 12, 2014 1:54 pm    Post subject:
Reply with quote

Alternatively, you can use the LASTDAYM subparameter to achieve the same:
Code:
//STEP01  EXEC PGM=SORT                                             
//SYSOUT  DD SYSOUT=*                                               
//SORTOUT DD SYSOUT=*                                               
//SORTIN  DD *                                                     
SELECT *                                                           
FROM XYZ.TABLE1                                                     
WHERE EFFECTIVE_DATE = 'DD.MM.YYYY'                                 
AND END_DATE = 'DD.MM.YYYY'                                         
//SYSIN   DD *                                                     
 OPTION COPY                                                       
 INREC IFTHEN=(WHEN=INIT,                                           
       OVERLAY=(81:DATE2-1,C'01',91:81,8,Y4T,LASTDAYM,TOGREG=Y4W(.),
                81:91,10,84:C'01')),                               
       IFTHEN=(WHEN=(1,1,CH,EQ,C'W'),OVERLAY=(25:81,10)),           
       IFTHEN=(WHEN=(1,1,CH,EQ,C'A'),OVERLAY=(17:91,10))
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. 00D3003B - time outs in DB2 when invo... chavinash2004 DB2 2 Mon Oct 09, 2017 4:39 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts VSAM RLS Wait time blayek JCL & VSAM 2 Mon Oct 02, 2017 9:05 pm

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