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

Override record with another record


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

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Fri May 09, 2008 10:46 pm
Reply with quote

Hi,

I have two input files with length 200.

In this file we will have only two records which starts from 9.
Requirement:

I need to splice this records as one with overriding 5th to 10th field with 2nd record on one condition i.e, 2nd row 5th to 10th value should be greater than 1st row 5th to 10th row value. If it is not then I need to write bad record output into another output file. If it is then I need to write spliced one record into my output file.

And If bad record output file is written then I need to abend the job.

Can any one help me out in this regarard

Thanks Ahead
Surya
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 May 10, 2008 1:58 am
Reply with quote

Please show examples of the records in each input file (relevant fields only) and what you expect for output for each variation. Explain the "rules" for getting from input to output in terms of the examples.

Give the RECFM and LRECL of the input files.

Give the starting position, length and format of all relevant fields.[/img]
Back to top
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Sat May 10, 2008 9:09 am
Reply with quote

Frank,
I got only 1 file which holds 2 records.
Record length of file = 200
Record format = FB

Records are like
9000123450000
9444678917777

here 5th to 10th position in 2 records is:
12345 and 67891.
First record 12345 is < 67891 hence this should write into my output like 9000678910000

If first record 5th position to 10th position > 2nd record 5th position to 10th position then Job need to abend.

Using Splice ICETOOL I am able to override 5th to 10th position. But not able to check the condition.

My Splice Statement :
SPLICE from(INPUT) TO(OUTPUT) on(1,1,zd) with(5,5)
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: Mon May 12, 2008 5:43 am
Reply with quote

That's the 5th to 9th position, not the 5th to 10th position.

Here's a DFSORT/ICETOOL job that will give you a RC=16 if the first record 5th position to 9th position > second record 5th position to 9th position; otherwise if it will give you a RC=0. If you really want an ABEND rather than RC=16, uncomment the DEBUG ABEND statement and you'll get a U0209 ABEND instead of RC=16.

Note: You need z/OS DFSORT V1R5 to use NULLOFL=RC16 - it won't work with DFSORT R14 (COUNT would).

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD DSN=...  input file (FB/200)
//OUT DD DSN=...  output file (FB/200)
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(1,1,ZD) WITH(5,5) USING(CTL1)
/*
//CTL1CNTL DD *
* DEBUG ABEND
  OPTION COPY
  INREC OVERLAY=(201:5,5)
  OUTFIL FNAMES=OUT,OMIT=(201,5,ZD,GT,5,5,ZD),
    BUILD=(1,200),NULLOFL=RC16
/*
Back to top
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Sun May 18, 2008 4:44 am
Reply with quote

Thanks Frank.

But In both conditions my JCL splicing the record. It is not giving an abend when first record 5th position to 9th position > 2nd record 5th position to 9th position. As you said I may not have the vesrion you mentioned.

As I dont have an option to use the JCL provided by you (NULLOFL), I am trying to do as below:

1) Overlay 2nd record 5th to 9th position at the last of first record
2) write an empty out put file using include cond when first record 5th position to 9th position > 1st record last 5 bytes.
3) If output file is empty then ICETOOL will give return code other than zero.(RC=12)
4) if return code is zero then my splice step will execute.

But I am not able to overlay 2nd record 5th to 9th position at the last of first record.

Frank, is this solution is fine or do you have any other solution? Can you please suggest me.
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: Sun May 18, 2008 4:51 am
Reply with quote

Hello,

Quote:
As I dont have an option to use the JCL provided by you (NULLOFL),
Why not?

Please post the sysout data from your sort execution.
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top