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
 

 

Process data prior to current day

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sreeharithag

New User


Joined: 26 Apr 2010
Posts: 9
Location: chennai

PostPosted: Wed Jun 01, 2011 5:49 pm    Post subject: Process data prior to current day
Reply with quote

Hi,
I need to process the data in input file which is prior to current day to output file.

My requirements are:
If the day is "MON", I need to process the data from friday to saturday.
If the day is other than "MON",I need to process the data prior to the current day.

The input file has the below fields having the LRECL of 30
Name(10)
Entry date(10)
Exit date(10)

Now I need to process the previous day data by comparing with the entry date. If it is "MON" and current date is 06-6-2011, then records which have the entry date 06-3-2011, 06-4-2011 and 06-5-2011 are to be processed.

If it is not equal "MON" and current date is 06-7-2011,then records which have the entry date 06-6-2011 are to be processed.

Input file should get filtered with the above conditions and written to output file having an LRECL of 30.

Thanks,
Haritha.
Back to top
View user's profile Send private message

Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 962
Location: Richmond, Virginia

PostPosted: Wed Jun 01, 2011 6:12 pm    Post subject:
Reply with quote

Very interesting. Thanks for letting us know what you are currently working on.

To whom should we send the invoice?
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Wed Jun 01, 2011 7:25 pm    Post subject:
Reply with quote

sreeharithagm
Please provide sample input and expected output. Do you want to write rejected/omitted records to different file or just skip them?

Quote:
If it is "MON" and current date is 06-6-2011, then records which have the entry date 06-3-2011, 06-4-2011 and 06-5-2011 are to be processed.
In this case do you always want to go back 3 days and filter records? Just to clarify, in the case above, you do want to omit records with entry date of 06-6-2011. Please confirm.

Also, is this post related to http://ibmmainframes.com/viewtopic.php?t=54742?

Thanks,
Back to top
View user's profile Send private message
sreeharithag

New User


Joined: 26 Apr 2010
Posts: 9
Location: chennai

PostPosted: Thu Jun 02, 2011 6:21 pm    Post subject:
Reply with quote

Hi,
I have tried using this below sort card but it is getting failed with
NO KEYWORDS FOUND ON CONTROL STATEMENT.

Code:

//STEP010 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SYMNAMES DD *
CUR_DAY,S'&WDAY'
/*
//SORTIN   DD DSN=INPUT,DISP=SHR
//SORTOUT  DD DSN=OUTPUT,
//            DISP=(,CATLG,CATLG),
//            UNIT=SYSTA,
//            SPACE=(CYL,(50,25),RLSE)
//SYSIN    DD *
    SORT FIELDS=COPY
    INREC FIELDS=(01:001,08,
                   09:09,26,
                   35:35,3,
                   40:CUR_DAY)
  OUTREC IFTHEN=(WHEN(40,3,CH,EQ,C'MON',AND,09,26,CH,GE,DATE4-3,
                   AND,09,26,CH,LE,DATE4),BUILD=(01:01,37))
           IFTHEN=(WHEN=(40,3,CH,NE,C'MON',AND,09,26,CH,LE,DATE4,
                   AND,09,26,CH,GE,DATE4-1),BUILD=(01:01,37))
/*
Please suggest how to resolve this.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7997
Location: Bellevue, IA

PostPosted: Thu Jun 02, 2011 6:29 pm    Post subject:
Reply with quote

Quote:
Please suggest how to resolve this.
First, you need to repost your JCL using the Code button to preserve the exact spacing of your JCL. Since you did not do so, it appears that your SORT control statements start in column 1, which is not allowed. Hence, based on what you've posted it does not appear your syntax for the SORT control statements is correct.

Also, you need to post a few lines of SORT output so we can know which SORT product you are using.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Thu Jun 02, 2011 7:28 pm    Post subject:
Reply with quote

sreeharithag,
Please provide sample input and expected output.

The INREC definition doesn't match with original layout you had provided. In the sort card, you are using 26 byte timestamp but in the original post you mentioned its a 10 byte date field (Entry date).

Thanks,
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jun 02, 2011 10:26 pm    Post subject:
Reply with quote

sreeharithag,

If I understand your requirement correctly, all you want to do is process friday thru monday records if the day of the week is monday and if it any other day you want to process the prior day records. If that is the case then you can use the following DFSORT JCL which will give you the desired results.

If you want to compare 26 byte timestamp field then you need to use DATE5 keyword instead of DATE4

Code:

//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SYMNAMES DD *                                                   
WKDAY,S'&WDAY'                                                   
//SORTIN   DD *                                                   
TUE     2011-05-31-11.35.31.697219AAA                             
WED     2011-06-01-11.35.31.697219BBB                             
THU     2011-06-02-11.35.31.697219CCC                             
FRI     2011-06-03-11.35.31.697219DDD                             
SAT     2011-06-04-11.35.31.697219EEE                             
SUN     2011-06-05-11.35.31.697219FFF                             
MON     2011-06-06-11.35.31.697219GGG                             
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                               
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(38:WKDAY,DATE5,DATE5)),       
  IFTHEN=(WHEN=(38,3,CH,EQ,C'MON'),OVERLAY=(41:DATE1(-)-3)),     
  IFTHEN=(WHEN=NONE,OVERLAY=(41:DATE1(-)-1))                     

  OUTFIL BUILD=(1,37),                                           
  INCLUDE=((9,26,CH,GE,41,26,CH),AND,(9,26,CH,LE,67,26,CH))       
//*
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am


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