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
 

 

IFTHEN IN SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: IFTHEN IN SORT
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: 3158
Location: Tucson AZ

PostPosted: Fri Feb 29, 2008 1:03 am    Post subject: Re: IFTHEN IN SORT
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    Post subject: Erroneous results
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: 2150
Location: At my coffee table

PostPosted: Fri Feb 29, 2008 1:16 am    Post subject:
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

Site Director


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

PostPosted: Fri Feb 29, 2008 1:17 am    Post subject:
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Fri Feb 29, 2008 1:23 am    Post subject:
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    Post subject: Works
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    Post subject: One more issue
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: 2150
Location: At my coffee table

PostPosted: Fri Feb 29, 2008 3:02 am    Post subject: Re: One more issue
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 Moderator


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

PostPosted: Fri Feb 29, 2008 3:02 am    Post subject:
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    Post subject: Full Info
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    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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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