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
 

 

Override record with another record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Override record with another record
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 Moderator


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

PostPosted: Sat May 10, 2008 1:58 am    Post subject:
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    Post subject: Reply to: Override record with another record
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 Moderator


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

PostPosted: Mon May 12, 2008 5:43 am    Post subject:
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    Post subject: Reply to: Override record with another record
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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun May 18, 2008 4:51 am    Post subject:
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    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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am


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