IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

FIELD ERROR while getting current TIME STAMP


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
avaneendra_linga

New User


Joined: 13 Dec 2006
Posts: 73
Location: Hyderabad

PostPosted: Thu Mar 29, 2007 8:38 pm
Reply with quote

HI WHILE RETRIEVING CURRENT TIME STAMP..I AM GETTING FILED ERROR...
CAN ANYBODY HELP ON THIS...

CARD:

Code:

  SORT FIELDS=(1,2,CH,A,3,60,CH,A,63,3,CH,A),EQUALS     
  OUTFIL REMOVECC,FNAMES=PASRC,INCLUDE=(1,2,CH,EQ,C'PA'),
  HEADER1=(1:C'PA',63:C'002',67:DATE4,C'.000000'),       
  TRAILER1=(1:C'PA',63:C'001',236:COUNT=(M11,LENGTH=10))


ERROR:

Code:

           HEADER1=(1:C'PA',63:C'002',67:DATE4,C'.000000'),
                                         $
ICE223A 0 REPORT FIELD ERROR
           TRAILER1=(1:C'PA',63:C'001',236:COUNT=(M11,LENGTH=10))
           $
ICE005A 0 STATEMENT DEFINER ERROR
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu Mar 29, 2007 9:05 pm
Reply with quote

DATE4 can be used in BUILD, but not in HEADERx or TRAILERx. However, you can do what you want with these DFSORT control statements:

Code:

  SORT FIELDS=(1,2,CH,A,3,60,CH,A,63,3,CH,A),EQUALS           
  OUTFIL REMOVECC,FNAMES=PASRC,INCLUDE=(1,2,CH,EQ,C'PA'),     
   HEADER1=(1:C'PA',63:C'002',                                 
     67:DATE=(4MD-),C'-',TIME=(24.),                           
     C'.000000'),                                             
   TRAILER1=(1:C'PA',63:C'001',236:COUNT=(M11,LENGTH=10))     
Back to top
View user's profile Send private message
avaneendra_linga

New User


Joined: 13 Dec 2006
Posts: 73
Location: Hyderabad

PostPosted: Fri Mar 30, 2007 1:10 pm
Reply with quote

THX FRANK....

it was working fine.......
here i got another requirement on the same......ie i should not write header and trailer in the output file if it is not satishfying my condition in INCLUDE.....
but for the above card ..even when it is satisfying the condition also ...it 's writing HEADER AND TRAILER in the output file.....
can you please help on this..?
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Fri Mar 30, 2007 1:30 pm
Reply with quote

How to recognize header and trailer records from other data in the file? Provide an example. Also, does the header and trailer are going to remain constant for every run?
Back to top
View user's profile Send private message
avaneendra_linga

New User


Joined: 13 Dec 2006
Posts: 73
Location: Hyderabad

PostPosted: Fri Mar 30, 2007 2:13 pm
Reply with quote

hi ,
we dont have any header and trailer records in the inputfile.......
we are creating header and trailer in the outputfile....
please see this..Code:

SORT FIELDS=(1,2,CH,A,3,60,CH,A,63,3,CH,A),EQUALS
OUTFIL REMOVECC,FNAMES=PASRC,INCLUDE=(1,2,CH,EQ,C'PA'),
HEADER1=(1:C'PA',63:C'002',
67:DATE=(4MD-),C'-',TIME=(24.),
C'.000000'),
TRAILER1=(1:C'PA',63:C'001',236:COUNT=(M11,LENGTH=10))
in this when first 2 chars are not equal also....this card is writing HEADER AND TRAILER...CAN WE AVOID WRITING THESE WHEN CONDITION IS NOT SATISFIED?.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Fri Mar 30, 2007 2:31 pm
Reply with quote

Avaneendra,

HEADER1 and TRAILER1 doesn't rely on INCLUDE condition and blindly prints the card contents at their respective positions.
Back to top
View user's profile Send private message
avaneendra_linga

New User


Joined: 13 Dec 2006
Posts: 73
Location: Hyderabad

PostPosted: Fri Mar 30, 2007 2:50 pm
Reply with quote

yes boss..thats what it is doing...............:-)

what was my clear question is...is there any way to retsrict the writing HEADER AND TRAILER records?...
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Fri Mar 30, 2007 5:18 pm
Reply with quote

No is the answer, unless Frank come up with clever solution.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Fri Mar 30, 2007 9:16 pm
Reply with quote

So you're saying if there are no included records, you don't want the header and trailer - you just want an empty file ... right? There's no way to tell DFSORT not to generate the Header and Trailer records for that case, but you can use this rather tricky DFSORT/ICETOOL job to get what you want:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG   DD  SYSOUT=*
//IN DD DSN=...  input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//CTL3CNTL DD DSN=&&C3,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//PASRC DD DSN=...  output file
//TOOLIN   DD    *
* Create T1 data set with header and trailer and
* T2 data set with count of included records.
* If count of included records is 0, generate:
*   OMIT COND=ALL
* to delete the header and trailer record -> empty output file.
* If count of included records is > 0, generate:
*   INCLUDE COND=ALL
* to copy the header, detail and trailer records to output file.
SORT FROM(IN) USING(CTL1)
COPY FROM(T2) TO(CTL3CNTL) USING(CTL2)
COPY FROM(T1) TO(PASRC) USING(CTL3)
//CTL1CNTL DD *
  SORT FIELDS=(1,2,CH,A,3,60,CH,A,63,3,CH,A),EQUALS
  OUTFIL REMOVECC,FNAMES=T1,INCLUDE=(1,2,CH,EQ,C'PA'),
   HEADER1=(1:C'PA',63:C'002',
     67:DATE=(4MD-),C'-',TIME=(24.),
     C'.000000'),
   TRAILER1=(1:C'PA',63:C'001',236:COUNT=(M11,LENGTH=10))
  OUTFIL REMOVECC,FNAMES=T2,NODETAIL,
   TRAILER1=(COUNT=(M11,LENGTH=10))
/*
//CTL2CNTL DD *
  INREC IFOUTLEN=80,
    IFTHEN=(WHEN=(1,10,ZD,EQ,+0),
      BUILD=(C' OMIT COND=ALL')),
    IFTHEN=(WHEN=NONE,
      BUILD=(C' INCLUDE COND=ALL'))
/*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts To get the the current time DFSORT/ICETOOL 13
Search our Forums:

Back to Top