IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Selecting Records in File 2 Based On Date in File 1


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Sat Sep 05, 2009 6:30 am
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
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
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
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
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

Moderator Emeritus


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

PostPosted: Wed Sep 09, 2009 9:41 pm
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
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

Moderator Emeritus


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

PostPosted: Fri Sep 11, 2009 7:30 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top