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

Inserting header to a file using SYNCSORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sprikitik

New User


Joined: 29 Jan 2007
Posts: 61
Location: Makati City, Philippines

PostPosted: Sun Mar 02, 2008 8:50 pm
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sun Mar 02, 2008 9:54 pm
Reply with quote

I'm sorry, but have you looked up 'header' in the OUTFIL Control Statements section of the sort manual?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Sun Mar 02, 2008 10:18 pm
Reply with quote

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
View user's profile Send private message
sprikitik

New User


Joined: 29 Jan 2007
Posts: 61
Location: Makati City, Philippines

PostPosted: Sun Mar 02, 2008 10:25 pm
Reply with quote

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
View user's profile Send private message
sprikitik

New User


Joined: 29 Jan 2007
Posts: 61
Location: Makati City, Philippines

PostPosted: Sun Mar 02, 2008 11:05 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Mon Mar 03, 2008 11:07 pm
Reply with quote

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
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Tue Mar 04, 2008 3:07 am
Reply with quote

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
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top