Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Multiple line Header to be appended prior to actual data

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Multiple line Header to be appended prior to actual data
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

Site Director


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

PostPosted: Fri Jan 16, 2009 3:30 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Jan 16, 2009 5:11 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Jan 16, 2009 10:56 am    Post subject:
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    Post subject:
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    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 File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 0 Tue Sep 26, 2017 3:35 am
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
No new posts PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us