View previous topic :: View next topic
|
Author |
Message |
sprikitik
New User
Joined: 29 Jan 2007 Posts: 61 Location: Makati City, Philippines
|
|
|
|
Hi!
Here's what i wanted to do using SORT:
I need to create a file using SORT. The first line of the the file should be
'STUDENT <5 spaces>LIST' the second line of the file should be:
'IDNO<10 spaces>NAME'. The third line should contain the IDNO and the NAME from the file to be sorted. Sample layout is:
Code: |
STUDENT LIST
IDNO NAME
1000 MICHAEL X
2000 JOHN X
|
Can anybody please help me how to accomplish this?
Thanks! |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
sprikitik,
You left out some details like the starting position, length and format of the IDNO and NAME fields in the input records, but this DFSORT job should give you the idea. I used HEADER2 (the page header) for the headings, but you can use HEADER1 (the report header) instead if that's appropriate.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
1000 MICHAEL X
2000 JOHN X
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,
HEADER2=(1:'STUDENT',13:'LIST',/,
1:'IDNO',15:'NAME'),
BUILD=(1:1,4,15:15,12)
/*
|
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
sprikitik
New User
Joined: 29 Jan 2007 Posts: 61 Location: Makati City, Philippines
|
|
|
|
Hi Frank,
Thanks for the quick reply.
One more question what if i needed to insert 80 spaces after LIST. How should I do it?
HEADER2=(1:'STUDENT',13:'LIST',14:___________________?
Thanks, |
|
Back to top |
|
|
sprikitik
New User
Joined: 29 Jan 2007 Posts: 61 Location: Makati City, Philippines
|
|
|
|
Hello,
I need to sort a file 80 bytes in length, the file should have 2 HEADERS
the first Line must be:
Positions 1-3 the value should be 'XXX'
Position 4 is SPACE
Positions 5-12 is 'XXXXXXXX'
Positions 13-80 is SPACES
The second line must be:
Positions 1-7 is 'XXXXXXX'
Position 8 is SPACE
Position 9-12 is 'XXXX'
Position 13-80 is SPACE
The 2 headers should only appear on TOP and on the third line, the detail line will start up to the end. There should be no page breaks. the detail line should continue without breaks until the end of the file.
Can anybody tell me how to accomplish this?
Please help me.. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
sprikitik,
Hmmm ... the Subject is "Inserting header to a file using SYNCSORT". I don't remember "SYNCSORT" being in the Subject when I first answered this.
I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
Are you using Syncsort (WERxxxs messages) or DFSORT (ICExxxs messages)? |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
sprikitik wrote: |
I need to sort a file 80 bytes in length, the file should have 2 HEADERS...The 2 headers should only appear on TOP and on the third line, the detail line will start up to the end. There should be no page breaks. the detail line should continue without breaks until the end of the file.
|
Try this:
Code: |
//SYSIN DD *
SORT FIELDS=(p,l,f,o)
OUTFIL REMOVECC,
HEADER1=(1:'XXX',5:'XXXXXXXX',80:X,/,
1:'XXXXXXX',9:'XXXX',80:X)
/*
|
Since you did not specify your SORT Keys, you will need to fill them in yourself... |
|
Back to top |
|
|
|