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

Creating a new report format based on an existing report


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

New User


Joined: 22 Jun 2009
Posts: 8
Location: Germany

PostPosted: Thu Apr 04, 2013 8:33 pm
Reply with quote

Hi all,

Is it possible to pick values from a particular dataset and put it in desired positions on a new dataset. For eg,

Existing dataset contains -

Code:
ABC              DEF             GHI

JKL  :    123         XYZ : 789
MNO:    456


Output should be -

New report
==========================
Code:
DEF lost against ABC on GHI ground

JKL (Jersey num: 123) and MNO(Jersey
num: 456) scored for ABC.

XYZ(Jersey num: 789) scored for DEF.

==========================

Note: This is not the orginal requirement.. I just cooked it up.
But the requirement I have is something similar.

Any help will be highly appreciated.

Thanks,
Jay

Code'd
Back to top
View user's profile Send private message
mjgjaggu

New User


Joined: 22 Jun 2009
Posts: 8
Location: Germany

PostPosted: Thu Apr 04, 2013 8:38 pm
Reply with quote

One more point -

All the values in the new output file are either picked from the old file or hardcoded values.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Apr 04, 2013 8:47 pm
Reply with quote

If there are rules which reliably map the input to output, yes, it can be done, in general, unless the rules require going beyond existing DFSORT functionality.
Back to top
View user's profile Send private message
mjgjaggu

New User


Joined: 22 Jun 2009
Posts: 8
Location: Germany

PostPosted: Fri Apr 05, 2013 2:00 pm
Reply with quote

Hi Bill,

Thanks for the quick reply.

Yes. There are specific rules.

1. The values to be picked from the old file are from specific position always and where it needs to be put in the new file is also fixed.
i.e. There is a mapping for each of the fields and the field positions.

2. The hardcoded values in the new file are also fixed, both for value and position.

Thanks,
Jay
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Apr 05, 2013 3:18 pm
Reply with quote

OK, but I was expecting at least a bit of a hint as to what the rules might be.

So, for the "first line" is it always "winner, loser, ground"? Can there be a tie?

How do you identify the "first line"? Absence of ":"?

Then you seem to have a number of lines which indicate who scored first for winner, then loser, then next line is winner/loser, etc until no more scores?

What is the maximum number of scores?

How to identify the "scores" lines?

What if there is no score?

RECFM and LRECL of input and output.

Some more representative sample data, covering the above, in the Code tags please.
Back to top
View user's profile Send private message
mjgjaggu

New User


Joined: 22 Jun 2009
Posts: 8
Location: Germany

PostPosted: Fri Apr 05, 2013 4:24 pm
Reply with quote

Hi Bill,

As I had mentioned in the initial post, that was only an example report. We do not have to check for conditions or derive values.

The basic requirement is to pick values from input file, from specific positions and place it in specific positions on the output file.
Along with this, I need to incorporate some static hardcoded text in the output file.

The record format is FB and LRECL is 133 for both input and output.

I am sorry if I made it more complicated :-).

Thanks,
Jay
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Apr 05, 2013 4:42 pm
Reply with quote

Quote:
I am sorry if I made it more complicated


nope, You are just not describing things properly ?

from You description it seems that the values You describe occur only once in the file

but the <report> name seems to imply differently
data repeated according to some <grouping>


post a longer example of the input data
alonf with the relative output expected
Back to top
View user's profile Send private message
mjgjaggu

New User


Joined: 22 Jun 2009
Posts: 8
Location: Germany

PostPosted: Fri Apr 05, 2013 5:19 pm
Reply with quote

Please find the exact requirement in the attachment.

All the labels in Black color are to be picked from the original file and put in their respective positions in the output file.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Apr 08, 2013 3:04 pm
Reply with quote

So, use a number of IFTHEN=(WHEN=GROUP with BEGIN to identify the lines containing the data you want, and PUSH to locate a copy of that data (all that you need) into different positions.

This will mean that all records after your last WHEN-GROUP contain all the data you need, and all the previous records are useless. So arrange for an OUTFIL INCLUDE to pick up a record which now has all the data.

Use OUTFIL BUILD with the "slash operator" (/) which allows multiple output records from a single input record. Use several of these to format your new report, with a mixture of the data you have PUSHed and the new constants that you need.
Back to top
View user's profile Send private message
mjgjaggu

New User


Joined: 22 Jun 2009
Posts: 8
Location: Germany

PostPosted: Mon Apr 08, 2013 4:17 pm
Reply with quote

Ok. Thanks. I will try this out..
In the meantime, If you could provide me with an example, it would really help my cause.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Apr 08, 2013 4:33 pm
Reply with quote

There are examples in the manuals of WHEN=GROUP. Just use multiple ones, putting different data into different places.

There are also examples of OUTFIL INCLUDE in the same place, and of OUTFIL BUILD with the '/' operator.


Code:

  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'1'),PUSH=(81:2,5)),
        IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'2'),PUSH=(86:2,5))
  OUTFIL INCLUDE=(1,1,CH,EQ,C'2'),
         BUILD=(C'NEW REP',3X,86,5,/,C'2ND LINE',2X,81,5)

//SYSIN DD *
1FIRST
2LASTT


Untested, but this should take the input "report", extract some "data" to, here, the last record (not because it is the last, but because it has '2' in the first position of the record), include only the last record, then produce a new "report" with contstants and the extracted data.

EDIT: Now "tested and tarted".
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 Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Adding first / last acct numerber to ... DFSORT/ICETOOL 7
No new posts InfoSphere OPTIM CSV ouput vs DSNTIUA... IBM Tools 3
Search our Forums:

Back to Top