Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
FIELD ERROR while getting current TIME STAMP

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: FIELD ERROR while getting current TIME STAMP
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 Moderator


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

PostPosted: Thu Mar 29, 2007 9:05 pm    Post subject:
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    Post subject: hi
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: 1439
Location: Bangalore,India

PostPosted: Fri Mar 30, 2007 1:30 pm    Post subject:
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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Fri Mar 30, 2007 2:31 pm    Post subject:
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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Fri Mar 30, 2007 5:18 pm    Post subject:
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 Moderator


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

PostPosted: Fri Mar 30, 2007 9:16 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Comparision with current time arunsoods DFSORT/ICETOOL 5 Thu Nov 09, 2017 10:37 am
This topic is locked: you cannot edit posts or make replies. Comparing current time with the time ... arunsoods SYNCSORT 1 Mon Oct 30, 2017 4:07 pm
No new posts -502 Error - Cursor already open anand jeyapaul DB2 7 Sun Oct 29, 2017 4:22 am
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us