Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Check the key values even if the job abends

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Check the key values even if the job abends
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 Moderator


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

PostPosted: Tue Apr 07, 2009 9:28 pm    Post subject:
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    Post subject: Reply to: need help in sorting
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    Post subject: Reply to: need help in sorting
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 Moderator


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

PostPosted: Tue Apr 07, 2009 10:13 pm    Post subject:
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    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 Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us