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
 

 

Help needed on Reformat and print trailer if account changes

 
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: Tue Aug 11, 2009 12:15 am    Post subject: Help needed on Reformat and print trailer if account changes
Reply with quote

Code:

38762916000001055760006363072080629                              VWELLS
38762916000000050000006389382080630                              VOBAMA
38762916000000001000006394653080630                              VAHARON
38762916000000050000006394917080630                              VCHICAG
T037593192340000097359                                                 
38762924000001365000310355451090702                              VMONTAL
38762924000001010000310519488090420                              VUSCIS
38762924000000000340310524331090428                              VNaeila
38762924000005131190310573202090513                              VKIM KA


Hi all,

I have an input file of 80 bytes, with some 10 different accounts, all appearing in 1st position. The requirement is, to reformat (different layout provided by the customer) based on account and also print a trailer once the account changes. The situation here is,the trailer in input file is different from output file. In the output file , I should move the whole record by 2 bytes.

Is this possible to reformat the detail records based on the account and also print the trailer when the Account number changes ?

Please do excuse me if any of my statements are not clear. I will try to provide more if required. Thanks for your help in advance.
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: Tue Aug 11, 2009 12:22 am    Post subject:
Reply with quote

Hello,

It will help if you post the output you want from that input. . .
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Tue Aug 11, 2009 12:45 am    Post subject: Output file
Reply with quote

Code:

38762916000001055760006363072080629              V
38762916000000001000006394653080630              V
38762916000000050000006394917080630              V
  T037593192340000000004
38762924000001365000310355451090702 V 
38762924000001010000310519488090420 V
38762924000000000340310524331090428 V
38762924000005131190310573202090513 V
  T001572879320000000105


Esentially, what needs to be done is (i have given only 2 accts here,there are 10 in total), the position of V changes for detail records. For the 2 mentioned accounts, for one it appears at 65 pos and for the 2nd it appears on 45 position.

But the trailer is in the same position, 3. It gives the amount and count.
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Tue Aug 11, 2009 12:56 am    Post subject: Spaces
Reply with quote

There are spaces after the data and Void indicator. I am not able to show the spaces in the above example. It is taking away my format example.
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: Tue Aug 11, 2009 1:09 am    Post subject:
Reply with quote

You can certainly use IFTHEN clauses to build the records differently for the different accounts.

Quote:
There are spaces after the data and Void indicator. I am not able to show the spaces in the above example. It is taking away my format example.


I added ubb code tags to show the correct layout - you can use them too.

But it's difficult to understand what you want to do because you don't really explain what you want for the trailer. For the input, you only show one T record, but for the output you show two T records. Are the T records actually in the input file? Do the Trailer records just have to be moved over 2 for the output file, or do they have to be changed in some way (how)?

Code:

  T037593192340000000004


How does this trailer record correspond to your statement that
Quote:
But the trailer is in the same position, 3. It gives the amount and count.


Where is the amount - how is it calculated?

Where is the count - how is it calculated (is it the count of details records + 1 for the trailer record, or something else?).

Are the trailer records present in the input file file and just copied to the output file moved over by 2 positions, or does a new trailer record have to be built or the old one overlayed in some way?
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Tue Aug 11, 2009 1:17 am    Post subject:
Reply with quote

Frank,

In the input file also,there is one trailer for each account.

In the input file, the record starts in position 1 , with an indicator "T" and followed by 11 bytes for amount and 10 bytes for count.

In the output file, the Indicator should appear in position 10. The amount should appear in position 25 for 11 and the count should appear in position 10 for 10.
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: Tue Aug 11, 2009 1:47 am    Post subject:
Reply with quote

You can use a DFSORT job like the following to do what you asked for. Your starting positions are not accurate, so adjust the starting positions as needed (e.g. it makes no sense to say the indicator should be in position 10 in the output and the count should appear in position 10 in the output, so I started the count in position 11 - adjust as needed).

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
38762916000001055760006363072080629                              VWELLS
38762916000000050000006389382080630                              VOBAMA
38762916000000001000006394653080630                              VAHARON
38762916000000050000006394917080630                              VCHICAG
T037593192340000097359
38762924000001365000310355451090702                              VMONTAL
38762924000001010000310519488090420                              VUSCIS
38762924000000000340310524331090428                              VNAEILA
38762924000005131190310573202090513                              VKIM KA
T037593192340000097359
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(1,8,CH,EQ,C'38762916'),
    BUILD=(1,35,65:66,1)),
   IFTHEN=(WHEN=(1,8,CH,EQ,C'38762924'),
    BUILD=(1,35,45:66,1)),
   IFTHEN=(WHEN=(1,1,CH,EQ,C'T'),
    BUILD=(10:1,1,11:13,10,25:2,11))
/*
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Tue Aug 11, 2009 6:00 pm    Post subject: Thanks Frank
Reply with quote

But how do I add trailer record, specific to the account ? Can that be accomodated inside the BUILD ?

Thanks once again for taking time to respond.
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Tue Aug 11, 2009 7:02 pm    Post subject: Sorry
Reply with quote

I didnt read closely. I do see you have a code for Trailer. That should work. Let me test and let you know. Thanks Frank.
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Tue Aug 11, 2009 7:13 pm    Post subject: It works
Reply with quote

Thank you Frank.
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 How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Help Needed with View Direct shailesh_do CA Products 2 Wed Jul 13, 2016 10:39 am
No new posts OUTREC FILELDS FAILS WITH ICE126A 2 ... balaji81_k DFSORT/ICETOOL 8 Sat Jul 02, 2016 1:22 am
No new posts DSN name in trailer kranthikumarb DFSORT/ICETOOL 7 Mon Feb 29, 2016 11:30 am
No new posts JCL SORT to split the file and put re... Bill Woodger DFSORT/ICETOOL 17 Wed Feb 17, 2016 4:17 pm


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