View previous topic :: View next topic
|
Author |
Message |
saquib.ahsan
New User
Joined: 22 Sep 2008 Posts: 6 Location: Pune
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
saquib.ahsan
New User
Joined: 22 Sep 2008 Posts: 6 Location: Pune
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
saiprasadh
Active User
Joined: 20 Sep 2006 Posts: 154 Location: US
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
saiprasadh
Active User
Joined: 20 Sep 2006 Posts: 154 Location: US
|
|
|
|
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 |
|
|
|