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

Adding Header to a PS..


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

Active User


Joined: 14 Dec 2008
Posts: 107
Location: India

PostPosted: Tue Mar 24, 2009 12:06 pm
Reply with quote

Hi all,

I have a ps which has data in the following format

Code:

4454           fdfdsf          12/21/2009
4454           fdfdsf          12/21/2009
4454           fdfdsf          12/21/2009
4454           fdfdsf          12/21/2009
                               12/21/2009     4
4454           fdfdsf          12/22/2009
4454           fdfdsf          12/22/2009
4454           fdfdsf          12/22/2009
4454           fdfdsf          12/22/2009
                               12/22/2009     4


I want to add a header to each clumn....
I am using DFSORT Aptil 2006 version
Plz tell me how can i do this using ajcl

Thanks,
Ravi
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: Tue Mar 24, 2009 9:36 pm
Reply with quote

You can use HEADER1 (report header) or HEADER2 (page header) on the OUTFIL statement to add headings for a SORT, MERGE or COPY operation.
For example:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  OUTFIL HEADER1=('Col1',16:'Col2',32:'Col3',47:'Col4')
/*


Would give the following in SORTOUT for you input example:

Code:

Col1           Col2            Col3           Col4     
4454           fdfdsf          12/21/2009               
4454           fdfdsf          12/21/2009               
4454           fdfdsf          12/21/2009               
4454           fdfdsf          12/21/2009               
                               12/21/2009     4         
4454           fdfdsf          12/22/2009               
4454           fdfdsf          12/22/2009               
4454           fdfdsf          12/22/2009               
4454           fdfdsf          12/22/2009               
                               12/22/2009     4         


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
rkarthik22

New User


Joined: 18 Apr 2009
Posts: 47
Location: India

PostPosted: Thu May 21, 2009 3:08 pm
Reply with quote

I have a same requirement as above

Quote:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL HEADER1=('Col1',16:'Col2',32:'Col3',47:'Col4')
/*


But i want the headers name as maximum legth like

OUTFIL HEADER1=('Column one',16:'Column two ',32:'Column three',47:'Column four')


If i ran the above code after changing , it throws error...something like overlapping.



//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL HEADER1=('Column one',16:'Column two ',32:'Column three',47:'Column four')
/*
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu May 21, 2009 3:27 pm
Reply with quote

Hi,

please show entire job output and try using code.

Code:
 OUTFIL HEADER1=('Column one',16:'Column two ',32:'Column three',47:'Column four')


How did you manage to run the above statement as it does not fit between cols 2-71.

Gerry
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: Thu May 21, 2009 9:20 pm
Reply with quote

The following gets RC=0:

Code:

//S1 EXEC PGM=SORT                                                   
//SYSOUT DD SYSOUT=*                                                 
//SORTIN DD *                                                       
//SORTOUT DD SYSOUT=*                                               
//SYSIN DD *                                                         
  OPTION COPY                                                       
  OUTFIL HEADER1=('Column one',16:'Column two ',32:'Column three',   
    47:'Column four')                                               
/*                                                                   


I don't know what you did to get an error message.

Quote:
If i ran the above code after changing , it throws error...something like overlapping.


This doesn't tell us anything useful. You need to show the //SYSOUT messages you received.
Back to top
View user's profile Send private message
rkarthik22

New User


Joined: 18 Apr 2009
Posts: 47
Location: India

PostPosted: Fri May 22, 2009 8:19 am
Reply with quote

This is my input file of layout 46

[/quote]
----+----1----+----2----+----3----+----4----+-
20000028332 000004313512125882314 0201 CCA UND
20036297151 000004313070312032516 0201 CCA UND
20069499809 000004313070314103703 0201 CCA UND

This is my sort card:

Quote:

//SYSIN DD *
OPTION COPY
OUTFIL HEADER1=(1:'CUST-PARTY-ID',
13:'CUST-ACCOUNT NUMBER',
35:'CUST ENTITY',
40:'CUST PRODUCT',
44:'CUST REL TYPE')
/*

This is the error i got:

ABENDED S000 U0016 CN(INTERNAL)


WER108I SORTIN : RECFM=FB ; LRECL= 46; BLKSIZE= 27968
WER110I SORTOUT : RECFM=FBA ; LRECL= 47; BLKSIZE= 32759
WER118A SORTOUT ILLEGAL OVERLAPPING FIELDS
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri May 22, 2009 8:46 am
Reply with quote

Hello,

You are using Syncsort not DSFORT.

The control info that has a problem is not the control info Frank confirmed works. . .icon_confused.gif

Quote:
This is the error i got:

ABENDED S000 U0016 CN(INTERNAL)
No, that is the abend. . . This is the error:
WER118A SORTOUT ILLEGAL OVERLAPPING FIELDS

The header fields overlap (this has nothing to do with the positions of the data fields) - you need to correct them. . .
Back to top
View user's profile Send private message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Thu Apr 29, 2010 3:54 pm
Reply with quote

Code:
********************************* TOP OF DATA ********************
 SYNCSORT FOR Z/OS  1.3.2.0R    U.S. PATENTS: 4210961, 5117495   (
                                    WELLPOINT HOLDINGS           
 SYNCSORT LICENSED FOR CPU SERIAL NUMBER 1BE6E, MODEL 2097 706   
 SYSIN :                                                         
  OPTION COPY                                                     
  OUTFIL HEADER1=('WELCOME')                                     
 WER276B  SYSDIAG= 1004134, 2856208, 2856208, 1984350             
 WER164B  6,880K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED
 WER164B     0 BYTES RESERVE REQUESTED, 988K BYTES USED           
 WER146B  36K BYTES OF EMERGENCY SPACE ALLOCATED                 
 WER108I  SORTIN   : RECFM=FB   ; LRECL=    80; BLKSIZE=    80   
 WER107A  SORTOUT  RECFM INCOMPATIBLE WITH REPORT WRITING       
 WER110I  SORTOUT  : RECFM=FB   ; LRECL=    30; BLKSIZE=   300   
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                   
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                   


is my SYSOUT

I found some error WER107A SORTOUT RECFM INCOMPATIBLE WITH REPORT WRITING...
How do I solve that???
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Apr 29, 2010 3:58 pm
Reply with quote

Have you tried using a RECFM more suited to carriage control in the first byte ?
Back to top
View user's profile Send private message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Thu Apr 29, 2010 4:25 pm
Reply with quote

Yes, I tried out with a FBA file format..It is working fine...
But can we try out the same on FB file...It is giving some error...U0016
Also I need to create the header record separately in a FBA file and then copy it into a FB file using
Code:
OUTREC FIELDS=(1:2,30).

Can this be avoided by any means????
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Apr 29, 2010 8:15 pm
Reply with quote

TS70363 wrote:
Yes, I tried out with a FBA file format..It is working fine...
But can we try out the same on FB file...It is giving some error...U0016
Try using somethign like:
Code:
OUTFIL REMOVECC,HEADER1=(...

Quote:
Also I need to create the header record separately in a FBA file and then copy it into a FB file using
Code:
OUTREC FIELDS=(1:2,30).

Can this be avoided by any means????
What are you asking, I'm lost- please rephrase your question.
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 Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Adding first / last acct numerber to ... DFSORT/ICETOOL 7
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Adding 'ODD' and 'EVEN' indicator at ... DFSORT/ICETOOL 6
Search our Forums:

Back to Top