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

Check the key values even if the job abends


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
charavind17

New User


Joined: 24 Sep 2008
Posts: 30
Location: chennai

PostPosted: Tue Apr 07, 2009 7:40 pm
Reply with quote

HI,
I have two files. and two are having keys in diffrent positions. I need to check the two keys and the one of key value should be one greater then the other. my program will check this and if does not satisfy my job will abend. Insteading of abending the job I need to check this condition before itself in JCl.

Example: file 1: key position is 11,4

Code:
MT1060CTL 8117 090406   CONTROL FILE - PROPOSED ORDER FEED


File 2: key postion is 71,4

Code:
AAAA                    DRP    HEADER FOR PROPOSED ORDER FILE200904068118IX
999999999999999999999999DRP    TRAILER FOR PROPOSED ORD FILE 000000000X
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: Tue Apr 07, 2009 9:28 pm
Reply with quote

Your description of what you want to do is quite confusing.

It appears you want to compare 11-14 of file1 to positions 71-74 of the first (HEADER) record of file2 - is that right?

Quote:
I need to check the two keys and the one of key value should be one greater then the other.


Are you checking specifically for

file1_key greater than file2_key or
file2_key greater than file1_key or
file1_key not equal to file2_key?

Quote:
Insteading of abending the job I need to check this condition before itself in JCl.


What do you want to happen if the comparison is not satisfied? What do you want to happen if the comparison is satisfied?

It would help if you want show an example of the input records and expected output when the keys satisfy the condition and when the keys don't satisfy the condition.

Give the RECFM and LRECL of the input files.

Does 'HEADER' actually appear in the first record of file1? If so, what is it's starting position?
Back to top
View user's profile Send private message
charavind17

New User


Joined: 24 Sep 2008
Posts: 30
Location: chennai

PostPosted: Tue Apr 07, 2009 9:48 pm
Reply with quote

Yes I am comparing 11-14 of file1 to positions 71-74 of the first (HEADER) record of file2

yes I am checking for file1_key greater than file2_key

If file1_key not greater then file2_key then I need to send an email saying that condition did not satisfied

If comparison is satisfied the I would let the program run.

RECFM=FB and LREC=80

Yes, File1 has header as first record.starting position is 1.
Back to top
View user's profile Send private message
charavind17

New User


Joined: 24 Sep 2008
Posts: 30
Location: chennai

PostPosted: Tue Apr 07, 2009 9:55 pm
Reply with quote

After condition is satisfied program runs then file1 is created by program putting the file2_key.Then again we will recieve File2 as input in that also key value should be greater then file1_key. Like that it goes on.
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: Tue Apr 07, 2009 10:13 pm
Reply with quote

I'm not sure if this will accomplish what you want to, but ...

Here's a DFSORT job that will give RC=0 if your condition is satisfied or RC=16 if your condition is not satisified. You can use the RC in the next step to determine what to do. As an example:

Code:

file1_key    file2_key   RC
8119         8118        0
8118         8118        16
8117         8118        16



Here's the job:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file1 (FB/80) - 1 record
//       DD DSN=...  input file2 (FB/80) - 2 records
//SORTOUT DD DUMMY
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,1,ZD)),
    IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(11:11,4))
  OUTFIL NULLOFL=RC16,
    OMIT=(81,1,ZD,EQ,1,OR,81,1,ZD,EQ,3,
      OR,(81,1,ZD,EQ,2,AND,11,4,ZD,LE,71,4,ZD))
/*
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
Search our Forums:

Back to Top