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
 

 

Adding Header to a PS..

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

Active User


Joined: 14 Dec 2008
Posts: 103
Location: India

PostPosted: Tue Mar 24, 2009 12:06 pm    Post subject: Adding Header to a PS..
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 Moderator


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

PostPosted: Tue Mar 24, 2009 9:36 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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    Post subject:
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: 1703
Location: Australia

PostPosted: Thu May 21, 2009 3:27 pm    Post subject:
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 Moderator


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

PostPosted: Thu May 21, 2009 9:20 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri May 22, 2009 8:46 am    Post subject:
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: 93
Location: Bangalore, India

PostPosted: Thu Apr 29, 2010 3:54 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Apr 29, 2010 3:58 pm    Post subject:
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: 93
Location: Bangalore, India

PostPosted: Thu Apr 29, 2010 4:25 pm    Post subject:
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

Senior Member


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

PostPosted: Thu Apr 29, 2010 8:15 pm    Post subject:
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    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 Adding records from two files into on... shiitiizz SYNCSORT 4 Mon Sep 19, 2016 8:41 pm
No new posts Adding a descending character to a file Steve Ironmonger DFSORT/ICETOOL 3 Fri Jul 15, 2016 4:57 pm
No new posts SE37 while adding element to endevor kalyan.v CA Products 5 Mon Apr 25, 2016 6:05 pm
No new posts Remove header only knobi SYNCSORT 5 Mon Feb 15, 2016 10:42 pm
No new posts GROUP - header data to be repeated in... Musab Ahmed DFSORT/ICETOOL 3 Mon Feb 01, 2016 11:36 am


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