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
 

 

Inserting header to a file using SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sprikitik

New User


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

PostPosted: Sun Mar 02, 2008 8:50 pm    Post subject: Inserting header to a file using SYNCSORT
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: 2150
Location: At my coffee table

PostPosted: Sun Mar 02, 2008 9:54 pm    Post subject:
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 Moderator


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

PostPosted: Sun Mar 02, 2008 10:18 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
sprikitik

New User


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

PostPosted: Sun Mar 02, 2008 10:25 pm    Post subject: Reply to: Inserting header to a file using SORT
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: 58
Location: Makati City, Philippines

PostPosted: Sun Mar 02, 2008 11:05 pm    Post subject: Help on Header Records
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 Moderator


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

PostPosted: Mon Mar 03, 2008 11:07 pm    Post subject:
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: 500
Location: USA

PostPosted: Tue Mar 04, 2008 3:07 am    Post subject: Re: Help on Header Records
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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