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
 
Comparing two files of variable length

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

New User


Joined: 16 Aug 2005
Posts: 4

PostPosted: Fri Apr 16, 2010 6:11 pm    Post subject: Comparing two files of variable length
Reply with quote

Hi,

I have two files.
Ist file has record length as 512
2nd file has record length as 323

The first file has START DATE and END DATE ,starting at pos (33,16)
The second file also has DATE starting at pos (16,8).

I need all the records from the second file ,if its DATE is falling between
START DATE and END DATE of first file.
i.e START DATE<= DATE in second file<=END DATE.
Back to top
View user's profile Send private message

sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Fri Apr 16, 2010 7:58 pm    Post subject:
Reply with quote

What is your current DFSort PTF level.

If you are unsure, please submit below job and give us informational message.

Code:
//SORTSTEP EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY


Thanks,
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: Fri Apr 16, 2010 10:04 pm    Post subject:
Reply with quote

manjulaa,

What is the RECFM and LRECL of each input file?

Show an example of the records in each input file and what you expect for output. If there can be duplicates within file1, show that in the example. If there can be duplicates within file2, show that in the example.
Back to top
View user's profile Send private message
manjulaa

New User


Joined: 16 Aug 2005
Posts: 4

PostPosted: Tue Apr 20, 2010 6:13 pm    Post subject: Reply to: Comparing two files of variable length
Reply with quote

Hi Frank,

Thank you very much for your reply..please see the details of the requirement below,

Both the files are of FB format and LRECL of first file is 512 and that of second file is 323

In the first file the dates are in the form of 9's compliment form.

i.e The date in first file is = 99999999-(date in yyyy-mm-dd format).

eq:if the date is 20070707 ,then in the file it is written as 79929292.

In the first file, there will be only one record and the START DATE and END DATE is

starting at POS 33-48(16 lengthand both are of 9's compliment form).Layout is as shown below.

----+----1----+----2----+----3----+----4----+----5---

xxxxxxxxxxxxxxx yyyyyyy G 7989978279899685
In the second file the date is present as COMP-3 format of 9's compliment of the date,and it can have duplicates w.r.t

dates also.It is starting at Pos 24.( PIC 9(08) COMP-3).

The layout is shown below,

----+----1----+----2----+----3----+----4----+----5--------
mmm nnnnnnnn qrÇ| ssssss15-MAR-201008z
mmm nnnnnnnn qrÇ| ssssss15-MAR-201008z
mmm nnnnnnnn qrÇ| ssssss15-MAR-201008z

The condition needs to be checked is(since the dates are in 9's compliment form)

START DATE in first file > DATE in second file is >END DATE in first file.


then I need all the records from the second file ,which satisfies this criteria(duplicates also if presents.)

Also the files layout is attached here with.

Once again thanks a lot for your help.....


The attachment was deleted (again), please read your mail and post the screen shot using cut and paste.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Tue Apr 20, 2010 6:54 pm    Post subject:
Reply with quote

Quote:
the dates are in the form of 9's compliment form.


what is the benefit of this?
This is a serious question and will implement if good reasoning exists.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Tue Apr 20, 2010 6:58 pm    Post subject:
Reply with quote

manjulaa


I would leave final decision on Admin but I think you should remove the attachment from your post. You forgot to remove your company's name at the left bottom corner and also by forum rules, I don't think you are allowed to attach documents in the post.


Copyright
You should not use our forums to post/attach/link any material which is knowingly false and/or defamatory, inaccurate, sexually oriented, abusive, harassing or threatening, contains viruses or other contaminating or destructive features, violates the rights of others, such as Content which infringes any copyright, trademark, patent, trade secret or violates any right of privacy or publicity, or otherwise violates any applicable law.. Feel free to ask the moderators before posting the downloaded materials from other sites.

Thanks,
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: Tue Apr 20, 2010 11:17 pm    Post subject:
Reply with quote

manjulaa,

Here's a DFSORT job that will do what I think you want.

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file1 (FB/512)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
  OPTION COPY
  OUTFIL BUILD=(C'STARTDATE,+',33,8,80:X,/,
                C'ENDDATE,+',41,8)
/*
//S2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input file2 (FB/323)
//SORTOUT DD DSN=...  output file (FB/323)
//SYSIN DD *
  OPTION COPY
  INCLUDE COND=(24,5,PD,LE,STARTDATE,AND,
                24,5,PD,GE,ENDDATE)
/*


For example if your input file2 had the following PD values starting in 24:

78888888
80000000
79899782
79899685
79899700

The 3rd, 4th and 5th records would be kept since they are between 79899782 and 79899685. I assumed equal to was included in "between" but you can change the INCLUDE statement to whatever you need.
Back to top
View user's profile Send private message
manjulaa

New User


Joined: 16 Aug 2005
Posts: 4

PostPosted: Wed Apr 21, 2010 12:59 pm    Post subject: Reply to: Comparing two files of variable length
Reply with quote

Hi Frank, Thanks a lot for ur help :-)
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm

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