View previous topic :: View next topic
|
Author |
Message |
kirankumarj
New User
Joined: 18 Dec 2007 Posts: 51 Location: delaware
|
|
|
|
I have two record types :
DTL0221200810000001240000500........................
TRL02222008000000500013504238
I need to reformat the records based on the record type.
I have something like this :
Code: |
OPTION COPY
INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'DTL'),
OVERLAY=(1:32,8,9:C'0',10:20,10,20:12,10,30:4,4,34:7,2,
36:40,8,66:390,1,81:48,40,141:88,40)),
IFTHEN=(WHEN=(1,3,CH,EQ,C'TRL'),
OVERLAY=(1:C'T',10:19,11,25:C'000',28:12,07))
|
What am I doing wrong here? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
kirankumarj wrote: |
What am I doing wrong here? |
What error are you getting?
Please post the entire sysouts..... |
|
Back to top |
|
|
kirankumarj
New User
Joined: 18 Dec 2007 Posts: 51 Location: delaware
|
|
|
|
The reformatting is not happening as required.
38769915023000000400000004023699115010001760176LAURIE ZORN I
38769915024000050000000500024699115010001760176DONNA GRIFFING I
TRL0222200001350423801350000135042 |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Are you looking for this for the trailer?
Code: |
T 00013504238 0000000005 |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Ok, that is not the output you want - what do you want the output to look like? |
|
Back to top |
|
|
kirankumarj
New User
Joined: 18 Dec 2007 Posts: 51 Location: delaware
|
|
|
|
Yes.
Also, in detail records :
LAURIE ZORN
DONNA GRIFFING
These should not appear. I only want to take specific portions of the input records and reformat it based on the record type.
Thanks for spending time. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
kirankumarj wrote: |
I only want to take specific portions of the input records and reformat it based on the record type. |
Then perhaps you should use BUILD instead of OVERLAY....
Quote: |
OVERLAY: Reformat each record by specifying just the items that overlay specific columns. Overlay lets you change specific existing columns without affecting the entire record. |
Quote: |
BUILD or OUTREC: Reformat each record by specifying all of its items one by one. Build gives you complete control over the items you want in your reformatted OUTFIL records and the order in which they appear. You can delete, rearrange and insert fields and constants. |
|
|
Back to top |
|
|
kirankumarj
New User
Joined: 18 Dec 2007 Posts: 51 Location: delaware
|
|
|
|
Works like a charm. Thanks for pointing it out. |
|
Back to top |
|
|
kirankumarj
New User
Joined: 18 Dec 2007 Posts: 51 Location: delaware
|
|
|
|
In the reformatted output record:
In position X, I want the 100th byte from input record.
In position X+10, I want the 50th byte.
Output file doesnt print any data in position X+10. cant it read 50th byte after reading 100th byte? |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
kirankumarj wrote: |
Output file doesnt print any data in position X+10. cant it read 50th byte after reading 100th byte? |
Yes it can, but maybe nothing is in the 50th byte of the input..... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Output file doesnt print any data in position X+10. cant it read 50th byte after reading 100th byte? |
Yes, it can but we don't know what control statements you're trying to use to do that or what's in your input record in those positions. You seem to make a lot of assumptions based on little information. And you seem to want answers based on giving little information. We're here to help, but you have to meet us at least halfway.
It would help if you'd show the control statements you're using. It would also help if you'd say what X is. Given that you started out using OVERLAY instead of BUILD without understanding what they do, it's hard to guess what random thing you're trying this time.
Given what you said and assuming X is 21, your BUILD would have something like this:
Code: |
BUILD=(...,21:100,1,31:50,1,...)
|
If you want more specific help, give more information about what you're doing. Show your control statements. Show an examle of the input records (relevant fields only), what you're getting for output and what you expect for output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of the relevant fields. |
|
Back to top |
|
|
kirankumarj
New User
Joined: 18 Dec 2007 Posts: 51 Location: delaware
|
|
|
|
My bad. The output file was specified as 80 bytes . I changed it to 200 and everything prints out.
Thanks guys. I appreciate your time and help.
From next time onwards,I would try to provide more and clear info. |
|
Back to top |
|
|
|