View previous topic :: View next topic
|
Author |
Message |
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
Hi All,
The requirement is as follows:
0200708291244 <-----HEADER(DATE AS YYYYMMDD & TIME AS HHMM)
1AAAAAAAAAAAAAAA
1BBBBBBBBBBBBBBB
1CCCCCCCCCCCCC
900000003 <-----TRAILER(COUNT)
So far this is what I had tried with:
OUTFIL REMOVECC,HEADER1=(1:C'0',2:&DATENS=(4MD),10:&TIME2)
I used &TIME2 since my requirement says so. But on using &TIME2, I get a syntax error as:
OUTFIL REMOVECC,HEADER1=(1:C'0',2:&DATENS=(4MD),10:&TIME2)
at the comma between 2:&DATENS=(4MD) and 10:&TIME2
By using &TIME the header appears successfully but not as per my needs.
Why is this difference between &TIME and &TIME2 and how to satisfy my above requirement??
Thank You ALL for your time on this. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Please post yout output with the error..... |
|
Back to top |
|
|
SCANDY
New User
Joined: 08 Aug 2007 Posts: 10 Location: Dalian, China
|
|
|
|
from the syntax of OUTFIL, it seems you cannot use TIME2 in HEADERn and TRAILERn, but you can use them in BUILD and OUTREC. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
balimanja
Check this link for for the formats to be used and there descriprions
OUTFIL Control Statements
Quote: |
Why is this difference between &TIME and &TIME2 and how to satisfy my above requirement?? |
There is no time syntax like &TIME2.
May be after checking the above link you will be comfortable about the formats/syntaxes to be used. |
|
Back to top |
|
|
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
Scandy,
THANK YOU.Basically my requirement is to add a header that contains a '0' followed by DATE(YYYYMMDD) followed by TIME(HHMM).
E.g.:
0200708301625
DETAILRECORDS
DETAILRECORDS
DETAILRECORDS
DETAILRECORDS
DETAILRECORDS
DETAILRECORDS
TRAILER
Sine I need TIME in HHMM format after DATE I had to use &TIME2 but there seems to be a problem with it.
Is there any alternative to add a header as per my req.?
THANK YOU |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
balimanja
Use this ICETOOL solution for your requirement.
Note that the O/p file OUT has DISP=MOD
Code: |
//*******************************************************
//STEP001 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
/*
//IN2 DD *
DETAILRECORDS
DETAILRECORDS
DETAILRECORDS
DETAILRECORDS
DETAILRECORDS
DETAILRECORDS
/*
//OUT DD DSN=O/P FILE... DISP=MOD
//TOOLIN DD *
COPY FROM(IN1) TO(OUT) USING(CP01)
COPY FROM(IN2) TO(OUT) USING(CP02)
/*
//CP01CNTL DD *
OUTREC OVERLAY=(C'0',2:DATE1,10:TIME2)
/*
//CP02CNTL DD *
OUTFIL REMOVECC,
TRAILER1=(C'9',2:COUNT-1=(M11,LENGTH=8))
/*
|
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
balimanja,
Here's a better way to do what you want with DFSORT (one pass). I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
1AAAAAAAAAAAAAAA
1BBBBBBBBBBBBBBB
1CCCCCCCCCCCCC
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,
IFOUTLEN=80,
IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(81,8,ZD,EQ,1),
BUILD=(C'0',DATE1,TIME2,/,1,80)),
TRAILER1=(C'9',COUNT=(M11,LENGTH=8))
/*
|
|
|
Back to top |
|
|
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
Thanks Frank, Krisprem, SCANDY, CICs guy.
Thank You ALL |
|
Back to top |
|
|
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
Sorry to have pulled up this topic.
Frank, as I was testing, I noticed that the header does not appear if there are no records in the file. Can you suggest a solution to this?
Thank You, |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
balimanja
Quote: |
Frank, as I was testing, I noticed that the header does not appear if there are no records in the file. Can you suggest a solution to this?
|
You can use my solution, it works even if there are no i/p record's. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
balimanja,
Quote: |
Frank, as I was testing, I noticed that the header does not appear if there are no records in the file. Can you suggest a solution to this? |
Yes. Here's a one-pass DFSORT solution for that situation:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
DUMMY
// DD DSN=... input file (FB/80)
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,
IFTHEN=(WHEN=(1,5,CH,EQ,C'DUMMY'),
BUILD=(C'0',DATE1,TIME2)),
TRAILER1=(C'9',COUNT-1=(M11,LENGTH=8))
/*
|
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Krisprems,
In your job, wouldn't you want the following for the OUTFIL statement to get the correct count of data records:
Code: |
OUTFIL FNAMES=OUT,REMOVECC,
TRAILER1=(C'9',2:COUNT=(M11,LENGTH=8))
|
Since your second COPY operator only deals with the detail records, why would you want COUNT-1 instead of COUNT? |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
Quote: |
Since your second COPY operator only deals with the detail records, why would you want COUNT-1 instead of COUNT?
|
Yes, you are right frank, i need not use COUNT-1. |
|
Back to top |
|
|
|