|
View previous topic :: View next topic
|
| Author |
Message |
ksk
Active User
.jpg)
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Hi,
I need to generate a file with 732 record length and I have to insert Column Names for each column. When I am providing Column values on the Header Section of the control card, columns are coming different rows instead of consecutively.
My Header in JCL:
| Code: |
//HDR1 DD *
HEADER:JOBNAME:TEMP-NAME.xml:Y:,
BusTin,BusName,YrEst,NumEmp,SaleSize,BusEntCode,EffStrtDate,BusStrt
Name,BusStrtNo,BusCityName,BusState
|
I am expecting output as below
| Code: |
BusTin,BusName,YrEst,NumEmp,SaleSize,BusEntCode,EffStrtDate,BusStrtName,BusStrtNo,BusCityName,BusState
|
But I am getting Ouptut as below:
| Code: |
BusTin,BusName,YrEst,NumEmp,SaleSize,BusEntCode,EffStrtDate,BusStrt
Name,BusStrtNo,BusCityName,BusState
|
Please let me know where I am wrong. |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
HDR1 is just an inline data stream, which means it is limited to 80 bytes.
you need to use a BUILD to create the 732 char record. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
It's not clear if you have an existing file that you want to add headers to, or if you want to generate an output file with headers in some way. But if you want to use page headers, the DFSORT statements would be something like this:
| Code: |
OPTION COPY
OUTFIL HEADER2=('BusTin,BusName,YrEst,NumEmp,SaleSize,BusEntCode,',
'EffStrtDate,BusStrtName,BusStrtNo,BusCityName,BusState')
|
If you want more specific help, you need to provide more details on what exactly you're trying to do, an example of input and expected output, RECFM and LRECL, etc. |
|
| Back to top |
|
 |
ksk
Active User
.jpg)
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Thanks Frank. I want to add header on the top of the existing file. In other words, the single line header of 732 length should be on the top of the file.
I am using below cards for Header and data massaging.
| Code: |
//TOOLIN DD *
COPY FROM(HDR2) TO(SRT1)
COPY FROM(IN) USING(CTL1)
|
| Code: |
//CTL1CNTL DD *
SORT FIELDS=(1,22,CH,A)
OUTFIL FNAMES=(SRT1)
INREC IFTHEN=(WHEN=INIT,
BUILD=(1,22,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'";',LENGTH=25),
|
I have many more BUILD statements. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
If I understand it correctly, you want to create your heading from an FB/80 file that looks like this:
| Code: |
HEADER:JOBNAME:TEMP-NAME.xml:Y:,
BusTin,BusName,YrEst,NumEmp,SaleSize,BusEntCode,EffStrtDate,BusStrt
Name,BusStrtNo,BusCityName,BusState
|
and insert it before your input records.
If so, you can use a DFSORT/ICETOOL job like the following:
| Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//HDR DD DSN=... header file (FB/80)
//IN DD DSN=... input file (FB/732)
//**** OUT MUST BE A MOD OUTPUT DATA SET
//OUT DD DISP=MOD,DSN=... output file (FB/732)
//TOOLIN DD *
RESIZE FROM(HDR) TO(OUT) TOLEN(732) USING(CTL1)
SORT FROM(IN) TO(OUT) USING(CTL2)
//CTL1CNTL DD *
OPTION SKIPREC=1
OUTFIL FNAMES=OUT,BUILD=(1,732,SQZ=(SHIFT=LEFT))
//CTL2CNTL DD *
INREC IFOUTLEN=732,
...
SORT FIELDS=(1,22,CH,A)
OUTFIL FNAMES=OUT
/*
|
|
|
| Back to top |
|
 |
ksk
Active User
.jpg)
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Thanks Frank. I was looking for Header on the top of the file with more than 80 record length.
I could achieve it using HEADER1 clause.
| Code: |
//SYSIN DD *
SORT FIELDS=(1,22,CH,A)
OUTFIL FNAMES=(SORTOUT),REMOVECC,
HEADER1=(1:c'column1|',9:c'column2|',28:c'column3'| etc ...
)
|
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|