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

IFTHEN IN SORT


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

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Fri Feb 29, 2008 12:58 am
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Feb 29, 2008 1:03 am
Reply with quote

kirankumarj wrote:
What am I doing wrong here?
What error are you getting?
Please post the entire sysouts.....
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Fri Feb 29, 2008 1:06 am
Reply with quote

The reformatting is not happening as required.

38769915023000000400000004023699115010001760176LAURIE ZORN I
38769915024000050000000500024699115010001760176DONNA GRIFFING I
TRL0222200001350423801350000135042
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Feb 29, 2008 1:16 am
Reply with quote

Are you looking for this for the trailer?
Code:
T        00013504238    0000000005
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: Fri Feb 29, 2008 1:17 am
Reply with quote

Hello,

Ok, that is not the output you want - what do you want the output to look like?
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Fri Feb 29, 2008 1:18 am
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Feb 29, 2008 1:23 am
Reply with quote

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
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Fri Feb 29, 2008 1:25 am
Reply with quote

Works like a charm. Thanks for pointing it out.
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Fri Feb 29, 2008 2:33 am
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Feb 29, 2008 3:02 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Fri Feb 29, 2008 3:02 am
Reply with quote

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
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Fri Feb 29, 2008 3:22 am
Reply with quote

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
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top