Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Can Date and Time be put together in Header?&TIME vs. &a

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
balimanja

New User


Joined: 14 Aug 2007
Posts: 39
Location: Bangalore

PostPosted: Wed Aug 29, 2007 12:55 pm    Post subject: Can Date and Time be put together in Header?&TIME vs. &a
Reply with quote

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
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Aug 29, 2007 2:26 pm    Post subject:
Reply with quote

Please post yout output with the error.....
Back to top
View user's profile Send private message
SCANDY

New User


Joined: 08 Aug 2007
Posts: 10
Location: Dalian, China

PostPosted: Wed Aug 29, 2007 6:17 pm    Post subject:
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Aug 30, 2007 1:53 pm    Post subject:
Reply with quote

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
View user's profile Send private message
balimanja

New User


Joined: 14 Aug 2007
Posts: 39
Location: Bangalore

PostPosted: Thu Aug 30, 2007 4:25 pm    Post subject:
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Aug 30, 2007 5:34 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Aug 31, 2007 4:49 am    Post subject:
Reply with quote

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
View user's profile Send private message
balimanja

New User


Joined: 14 Aug 2007
Posts: 39
Location: Bangalore

PostPosted: Mon Sep 03, 2007 1:28 pm    Post subject:
Reply with quote

Thanks Frank, Krisprem, SCANDY, CICs guy.

Thank You ALL
Back to top
View user's profile Send private message
balimanja

New User


Joined: 14 Aug 2007
Posts: 39
Location: Bangalore

PostPosted: Tue Sep 18, 2007 5:05 pm    Post subject:
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Sep 18, 2007 8:48 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Sep 18, 2007 10:08 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Sep 18, 2007 10:09 pm    Post subject:
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Sep 20, 2007 9:23 pm    Post subject:
Reply with quote

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
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 Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts DSNACCOX (can it be run on 1 db/ts, t... SRICOBSAS DB2 3 Sat May 06, 2017 12:59 am
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
No new posts Application not run by time HH:MM tri... jzhardy IBM Tools 1 Sun Apr 09, 2017 3:22 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us