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
 

 

how to format records in 2 different ways using dfsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
deb_parthas

New User


Joined: 24 Nov 2005
Posts: 18

PostPosted: Wed Dec 14, 2005 4:48 pm    Post subject: how to format records in 2 different ways using dfsort
Reply with quote

Hi Friends,
I have a file with some thousands records. All are detail records except the last one. There is no field to distinguish the trailor record except that its the last one. Now, I want to reformat the detail records and the trailor record in two different ways using DFSORT. Could you please let me know how to do that?

Thank you,
Partha
Back to top
View user's profile Send private message

fixdoubts

New User


Joined: 21 Oct 2005
Posts: 54

PostPosted: Wed Dec 14, 2005 6:05 pm    Post subject:
Reply with quote

hi,

i think u know what exactly is the data in the trailor record

like 'this is the trailor record'

you can use the include cond feature with 'this' as ur value base.

ex : INCLUDE COND=(1,4,CH,EQ,C'this') or some thing similar to this.

pls correct me if am wrong.

Regards,
Back to top
View user's profile Send private message
Alain Benveniste

New User


Joined: 14 Feb 2005
Posts: 88

PostPosted: Wed Dec 14, 2005 6:50 pm    Post subject:
Reply with quote

Partha,

Show us what you mean by reformat details & the trailer. How do you want your records look like ?

Alain
Back to top
View user's profile Send private message
pushpagiri

New User


Joined: 07 Jul 2005
Posts: 51

PostPosted: Wed Dec 14, 2005 7:25 pm    Post subject:
Reply with quote

Hi,

It would be better if you give some example records.As of now
refer this link to get some clue on manipulating last record.

http://ibmmainframes.com/viewtopic.php?t=4603&start=0&postdays=0&postorder=asc&highlight=count

If you give some example,we can figure out your exact problem and
will be easy to give you some solution.
Back to top
View user's profile Send private message
deb_parthas

New User


Joined: 24 Nov 2005
Posts: 18

PostPosted: Wed Dec 14, 2005 7:49 pm    Post subject: Re: how to format records in 2 different ways using dfsort
Reply with quote

The file is FB=80 and will remain the same after formatting. I have the records as below..

00000000005131100020318020121205000000006070047755540
00000000005131100020318070121205000000019381046440755
00000000005131100020318110121205000000862266055565565
00000000005131100020318120121205000000249401055565566
00000000005131100020318150121205000000106207041244513
00000000005131199999999900000310000282777933

The last one is a trailer record while all other are data records. Any number of data records could be there.
I need to reformat the fields in the records like increasing length of a field by adding zeros, inserting spaces in between fields etc..
The formatting would be the same for all data records but different for the last record.
I plan to use OUTREC for formatting. But not sure how to seperate out the tarilor record and do a different OUTREC.
The trailor record has spaces in 45-53 while data records have numeric values.
hope these will assist you..

Thanks a lot guys,
Partha
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: Wed Dec 14, 2005 9:24 pm    Post subject:
Reply with quote

Quote:
The trailor record has spaces in 45-53 while data records have numeric values.


So the trailer record is identifiable. You can use a DFSORT job like this to do what you want. Just use the first BUILD for the data records and the second BUILD for the trailer record (BUILD has the same syntax as OUTREC).

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
* Reformat data records
  INREC IFTHEN=(WHEN=(45,9,CH,NE,C' '),
          BUILD=(...)),
* Reformat trailer record
        IFTHEN=(WHEN=NONE,
          BUILD=(...))
/*


You'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) in order to use DFSORT's IFTHEN function. Only DFSORT has this function, so if you don't have DFSORT, you won't be able to use it. If you do have DFSORT, but you don't have the Dec, 2004 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/pdug/
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 Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm
No new posts How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am


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