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: 1544
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: 2296
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
No new posts Data security erase on RAID device steve-myers All Other Mainframe Topics 0 Sat Jan 13, 2018 6:41 am
No new posts Append the milliseconds to the data s... girishb2 DFSORT/ICETOOL 1 Thu Dec 21, 2017 9:07 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm

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