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
 
Selecting Records in File 2 Based On Date in File 1

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

New User


Joined: 20 May 2005
Posts: 11
Location: IRELAND

PostPosted: Fri Sep 04, 2009 11:20 pm    Post subject: Selecting Records in File 2 Based On Date in File 1
Reply with quote

Hi Folks, I need to extracts records from File2 which has a Date2 in YYMMDD format comparing File1 which has a Date1 in CCYYMMDD format.

The Date1 in FILE1 is in postion '1'. LRECL 42 FB
The Date2 in File2 is in Postion'153(149+4)' LRECL 752 VB

The condition of including records is DATE2 = DATE1 -1. Meaning I have system process date going to be generated dynamically by some process.

My process need to read that Date in FILE1 and extract all the records from FILE2 which are processed y'day.

I know to use SPLICE using '11' & '22' and matching with '12'. But this thing is a bit different as there is one Day difference.

If anyone can give an idea whether I can use ICETOOL for this will be of a great help.

Have a nice weekend.
-Hari.
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Sep 05, 2009 6:30 am    Post subject:
Reply with quote

Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
Back to top
View user's profile Send private message
kasibhatla_hari

New User


Joined: 20 May 2005
Posts: 11
Location: IRELAND

PostPosted: Mon Sep 07, 2009 4:57 pm    Post subject:
Reply with quote

Hi Frank,

Input File1: Only 1 record will be there in FILE1 i.e. Current Processing
----------------------------------------------------------------------------------
Date in POS 1. This File is FB 42.
--------
Code:
Command ===>
******************
20090907
******************


Input File2: Date in POS 153 (149 +4 as it is VB)
---------------------------------------------------------

Code:
 Command ===>
-5----+----6----+----
090907X.......020527
090412X.......030911P
080611X.......020917
850831X.......090903P
090906X.......061106P
051121X.......090507
090906X.......070415X


My Output should look as below: All duplicates are required to be output
----------------------------------------------------------------------------------

Code:
090906X.......061106P
090906X.......070415x


So, I am required to check the Reference Proc Date and Output all the records with Reference Proc Date - 1.

Hope I am clear.
Thanks in advance for all your help.
With Regards
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Sep 08, 2009 11:17 pm    Post subject:
Reply with quote

kasibhatla_hari,

Is the date file having current date or anydate ?. If it is current date then you can directly use DATE1 parm to get the desired results


Code:

//SYSIN    DD *                           
  SORT FIELDS=COPY                       
  INCLUDE COND=(153,6,Y2T,EQ,Y'DATE1'-1) 
/*


If you need to validate the weekends it can be done also . But if you any date other than an offset from current date , then it needs a lot of work around to get the desired results as DFSORT does not support date arthimetic
Back to top
View user's profile Send private message
Singaram

New User


Joined: 19 Aug 2009
Posts: 19
Location: India

PostPosted: Wed Sep 09, 2009 1:22 am    Post subject:
Reply with quote

How about storing the date - 1 arithmetic itself in a file (using REXX scripts or some other standard procedures) and then comparing the file2 against this manipulated date.

Hope that will be a direct comparison in sort!!
Back to top
View user's profile Send private message
kasibhatla_hari

New User


Joined: 20 May 2005
Posts: 11
Location: IRELAND

PostPosted: Wed Sep 09, 2009 4:09 am    Post subject:
Reply with quote

Hi Kolusu,
The date is going to be a Proc date generated by system and it is not the current date always. In some scenarios it can be current date but differs in case of long weekends like Halloween in which case Monday is a holiday etc.

I cannot use splice as the fields cannot be matched. If any DFSORT solution will save me lot of time in writing a COBOL or SAS.

Thanks and Regards
-Hari.

Hi Singaram, I am not that gud in REXX except creating dynamic GDGs etc. The main concern is any program other than JCL will go thru lots of QA process which is time consuming. Thats all.
Thanks and Regards,
-Hari.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Wed Sep 09, 2009 9:41 pm    Post subject:
Reply with quote

Hello,

Quote:
The main concern is any program other than JCL will go thru lots of QA process which is time consuming
Regardless of the "code" used, the promotion process should be the same.

It is an incredibly poorly managed environment that allows promotion of processes without the review. . .
Back to top
View user's profile Send private message
kasibhatla_hari

New User


Joined: 20 May 2005
Posts: 11
Location: IRELAND

PostPosted: Fri Sep 11, 2009 4:37 am    Post subject:
Reply with quote

dick no one can drop anything without QA live. what i mean to say is the level of effort required to QA a JCL is less than what required for anything else. Anything JCL consumes less effort and cost.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Sep 11, 2009 7:30 pm    Post subject:
Reply with quote

Hello,

Quote:
what i mean to say is the level of effort required to QA a JCL is less than what required for anything else
I completely understood what you meant to say icon_smile.gif My point is that this is a very bad practice. Why should "code" in one language be more effort to promote than code in some other language?

When code is implemented using sort control statements, it is still code. Adding a process (jcl) is often less effort than adding code, but this is adding code and people are trying to "beat the system" by calling this code jcl (it is not).

Whatever would be validated for cobol code should be validated for this application as well.

To do otherwise just demonstrates that is a great environment for lack of quality and eventual failure.
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 Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 6 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm

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