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

Multiple line Header to be appended prior to actual data


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

New User


Joined: 22 Sep 2008
Posts: 6
Location: Pune

PostPosted: Fri Jan 16, 2009 3:26 am
Reply with quote

I have a problem wherein i need to insert multiple line header before the actual data. Let me explain it further, and then come back to the question:

File1 (FixedBlock): format -> Date <2 spaces>Count
2008-12-29 000000000
2008-12-30 000000000

I want a Header in the following format
Date<8 spaces> Count of
Retries

I am able to add the first line of the header using OUTFIL HEADER1 option and the OUTREC option of syncsort, but i dont have a clue how to add the second row of the header.

Can someone help me out on this. I do not want to hard code the header format in a file and then merge the two files. Can it be done using OUTFIL HEADER1 options?
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 Jan 16, 2009 3:30 am
Reply with quote

Hello,

You need to provide the information Frank requested to your earlier reply to the other topic. . .
Quote:
If you want a DFSORT solution, post it in the DFSORT Forum. Otherwise, post it in the JCL Forum. Show an example of the records in the input file (relevent fields only) and what you expect for output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of each relevant field.

Which sort product is used on your system?
Back to top
View user's profile Send private message
saquib.ahsan

New User


Joined: 22 Sep 2008
Posts: 6
Location: Pune

PostPosted: Fri Jan 16, 2009 3:41 am
Reply with quote

I am using SYNCSORT

details of data file (file1) is as below:
DCB=(RECFM=FB,LRECL=20,BLKSIZE=200)
Date -> first 10 characters
Filler -> 2 spaces
Count -> 8 characters

Format of Header is as below:
Date <8 spaces> Count of -> first line of Header
<14 spaces> Retries -> second line of Header
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 Jan 16, 2009 5:11 am
Reply with quote

Hello,

Please post some sample input data (not a high volume, but enough to demonstrate the requirement) and the output you want from that input. When posting code, control statements, or data, it is best to use the "Code" tag for readability.
Back to top
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Fri Jan 16, 2009 9:34 am
Reply with quote

Hi,

I hope the below SORT card will meet your requirement

Code:
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT,REMOVECC,
   HEADER1=(1:C'DATE',8X,13:C'COUNT',4X,/,
                    1:14X,15:C'RETRIES')



Thanks
Sai
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 Jan 16, 2009 10:56 am
Reply with quote

Hi Sai,

Thanks for posting the sort control info.

It will help if you also post some actual input records and the output you want when these are processed. Show the actual data and headers for the relevant positions of the input and output. This does not need to be a high volume of data - just enough to demonstrate the requirement/rules.

If we can see "what data you have" and "what data you need" it will help us help you.
Back to top
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Fri Jan 16, 2009 8:22 pm
Reply with quote

Hi,

Please find the example

Code:
//STEP01  EXEC PGM=SORT                       
//SYSPRINT  DD SYSOUT=*                       
//SYSOUT    DD SYSOUT=*                       
//SORTIN    DD *                             
2008-01-01  00000001                         
2008-02-01  00000001                         
2008-03-01  00000001                         
2008-04-01  00000001                         
/*                                           
//SORTOUT   DD DSN=VSEKARS.SYSREC3,           
//             DISP=(NEW,CATLG,DELETE),       
//             UNIT=SYSDA,                   
//             SPACE=(CYL,(100,200),RLSE),   
//             DCB=(*.SORTIN)                 
//SYSIN  DD  *                               
 SORT FIELDS=COPY                             
 OUTFIL FNAMES=SORTOUT,REMOVECC,             
    HEADER1=(1:C'DATE',8X,13:C'COUNT',3X,/,   
                     1:13X,14:C'RETRIES'),   
    OUTREC=(1:1,10,2X,13:13,8)               
/*                                           

Output:

DATE        COUNT   
             RETRIES
2008-01-01  00000001
2008-02-01  00000001
2008-03-01  00000001
2008-04-01  00000001

Thanks
Sai
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 How to save SYSLOG as text data via P... All Other Mainframe Topics 4
No new posts Store the data for fixed length COBOL Programming 1
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
Search our Forums:

Back to Top