Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 1529
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: 2165
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 Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
This topic is locked: you cannot edit posts or make replies. Get a job submitted itself every time... arunsoods JCL & VSAM 3 Tue Nov 22, 2016 4:05 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us