View previous topic :: View next topic
|
Author |
Message |
Aravind_mf
New User
Joined: 06 Mar 2009 Posts: 13 Location: chennai
|
|
|
|
Hi,
I have a requirement of comparing two GDG files(File1 and File2). The two GDG files will have date in the format CCYYMMDDHHMMSS.
Example 20090625103311.
I have to compare for date in File1 is greater that date in File2. If File1 date is greater then I have to call an abend routine (we have our own abend routine) else proceed to execute the other steps.
Please help me in acheving my requirement.
Thanks
Aravind |
|
Back to top |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
i think its a simple compare of two file. you can you a COBOL program with the below logic...
Code: |
INI-Para
read file1
read file2
PROCESS-Para
if date1 > date2
call abend
else
proceed further and read the files again.
|
|
|
Back to top |
|
|
Aravind_mf
New User
Joined: 06 Mar 2009 Posts: 13 Location: chennai
|
|
|
|
Sorry guys, I should have been more specific. I want the above requirement to be implemented through JCL. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
As the requirement is been posted in JCL section of the Forum, what kind of solution you are looking for-- probably SORT? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Aravind_mf wrote: |
Sorry guys, I should have been more specific. I want the above requirement to be implemented through JCL. |
As is so often stated in the forum, JCL by itself does nothing except communicate to the processor which program is to be executed, which files are to be used for the specific DD names, and also may be used to pass parameters to the selected program.
Given that you wish to achieve this through JCL you need to specify which program you would like executed to achieve the end result. |
|
Back to top |
|
|
Aravind_mf
New User
Joined: 06 Mar 2009 Posts: 13 Location: chennai
|
|
|
|
OK. I would like to use SORT,DFSORT or ICETOOL(may be?). |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Is there only one record in each input file?
What is the starting position, length and format of the date field?
If I show you how to get a RC=16 if the file1 date is greater, or RC=0 otherwise, do you know how to use the return codes to determine whether or not to call your routine? |
|
Back to top |
|
|
Aravind_mf
New User
Joined: 06 Mar 2009 Posts: 13 Location: chennai
|
|
|
|
Frank,
yes each file will have one record in it in the format (CCYYMMDDHHMMSS). Starting pos is 1 and End pos is 14.
For example, if File1 contains - 20090621112255 and File2 contains 20090621122250 then if I compare File1>File2 then it should abend.
Yes I know how to use return codes using COND statement to call my routine. Please let me know how to get RC=16 or RC=0 for the comparision.
Thanks
Aravind |
|
Back to top |
|
|
sankaranarayanan parasura
New User
Joined: 28 Oct 2007 Posts: 10 Location: chennai
|
|
|
|
Aravind,
Why can't you use a jobstep calling REXX program to parse two input files to check the dates and set the RC =16 or 0 based on the timestamp record in the files.
Sankar |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for. If date1>date2, DFSORT will pass back RC=16. Otherwise, DFSORT will pass back RC=0.
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file1
// DD DSN=... input file2
//OUT DD DUMMY
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(15:1,14))
OUTFIL FNAMES=OUT,STARTREC=2,OMIT=(15,14,ZD,GT,1,14,ZD),
NULLOFL=RC16
/*
|
|
|
Back to top |
|
|
Aravind_mf
New User
Joined: 06 Mar 2009 Posts: 13 Location: chennai
|
|
|
|
Frank,
Thanks for your reply. the INREC statement
INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH(15:1,14)) is not working and says as the statement has syntax error.
SYNCSORT FOR Z/OS 1.2.3.1R U.S. PATENTS: 4210961, 5117495 (C) 2005 SYNCSO
BANK OF AMERICA-Z/OS SYNCSORT R1.2 MARCH 2006 z/O
PRODUCT LICENSED FOR CPU SERIAL NUMBER 1630E, MODEL 2094 603 LICEN
SYSIN :
OPTION COPY 0000005
INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH(15:1,14)) 0000006
*
OUTFIL FNAMES=OUT,STARTREC=2,OMIT=(15,14,ZD,GT,1,14,ZD),NULLOFL=RC16 0000007
WER268A INREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
I suppose IFTHEN statement is not being recognised. please need your expertise help. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
The product that you are using is SYNCSORT, not DFSORT.
These are two different products, developed and marketed by two seperate companies.
Please be aware, hopefully BEFORE you post which product you use.
ICE messages indicate DFSORT, WER messages for SYNCSORT. Hardly rocket science ......... is it
Topic moved to the JCL forum for SYNCSORT solutions. |
|
Back to top |
|
|
Aravind_mf
New User
Joined: 06 Mar 2009 Posts: 13 Location: chennai
|
|
|
|
Apologies, it seems my shop will support only SYNCSORT. Can you please help to acheive this requirement in SYNCSORT |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Aravind,
The below SyncSort job would produce the desired results.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=... input file1
//SORTJNF2 DD DSN=... input file2
//SORTOUT DD DUMMY
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(15,1,A)
JOINKEYS FILE=F2,FIELDS=(15,1,A)
REFORMAT FIELDS=(F1:1,14,F2:1,14)
INCLUDE COND=(1,14,ZD,GT,15,14,ZD)
SORT FIELDS=COPY
OPTION NULLOUT=RC4 |
If date-1 > date-2, RC=0 else RC=4 |
|
Back to top |
|
|
Aravind_mf
New User
Joined: 06 Mar 2009 Posts: 13 Location: chennai
|
|
|
|
Its working. Thanks a lot Arun. Also can you let me know what are the return codes that can be specified in the NULLOUT statement? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Aravind_mf wrote: |
Its working. Thanks a lot Arun. Also can you let me know what are the return codes that can be specified in the NULLOUT statement? |
Do YOU not have access to the product documentation ? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
can you let me know what are the return codes that can be specified in the NULLOUT statement? |
SyncSort for z/OS 1.2 Manual wrote: |
NULLOUT= RC0 /RC4 /RC16 |
If you dont have access to a manual, request for one from Use [URL] BBCode for External Links or send a PM to Alissa Margulies(JCL Moderator). They'll help you further. |
|
Back to top |
|
|
|