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

DFOSRT - Parse & Split the CSV file to multiple ouputs


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

New User


Joined: 05 Apr 2007
Posts: 38
Location: india

PostPosted: Fri Feb 27, 2009 3:45 am
Reply with quote

Dear Frank,

I shall send the source of my job.But the same job works fine when i code only
Code:
SORT FIELDS=(6,15,CH,A)


Thanks
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 Feb 27, 2009 4:01 am
Reply with quote

The message indicates that you have a "short" record ... one that is shorter than the second SORT field you asked for. But the values shown in the message DO NOT match the fields shown in the SORT statement (they should match), and the use of the IFTHEN clauses would NOT allow that situation to be created. So I don't think what you've posted here is what you got that error message for (unless there's something else going on that you're not showing or aware of).

If you send me the source for the JOB and the complete set of JES and DFSORT messages, then I can probably figure out what's really going on.
Back to top
View user's profile Send private message
suyerasi

New User


Joined: 05 Apr 2007
Posts: 38
Location: india

PostPosted: Fri Feb 27, 2009 4:27 am
Reply with quote

Dear Frank,

I have sent a offline note with the job details to your IBM mail-id. Please look into it & let me know where exactly the problem is.

Thanks
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 Feb 27, 2009 4:39 am
Reply with quote

I received your messages offline.

I was looking at your original post that showed 261 in the ICE218A message and missed your correction to 265 in the ICE218A message. That makes more sense.

I guess you're only building certain records out to 265 bytes. It looks like the header records can end up being shorter than 265 bytes. So when you try to use a SORT field of 262,4,CH,A for one of these short records, you get the error message. The way to get around that normally is to use VLSHRT, but VLSHRT is being turned off because you're using INREC.

The solution would be to use two passes - one with INREC and the other with VLSHRT, SORT and OUTFIL like this.

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)
//OUT1 DD DSN=...  output file1
//OUT2 DD DSN=...  output file2
//TOOLIN DD *
COPY FROM(IN) TO(T1) USING(CTL1)
SORT FROM(T1) USING(CTL2)
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,6:5)),
   IFTHEN=(WHEN=GROUP,
     BEGIN=(6,3,CH,EQ,C'>>>'),PUSH=(5:ID=1)),
   IFTHEN=(WHEN=(6,3,CH,NE,C'>>>'),
    FINDREP=(INOUT=(C'"',C'')),HIT=NEXT),
   IFTHEN=(WHEN=(6,3,CH,NE,C'>>>'),
   PARSE=(%01=(ABSPOS=6,ENDBEFR=C',',FIXLEN=15),
       %02=(ENDBEFR=C',',FIXLEN=26),
       %03=(ENDBEFR=C',',FIXLEN=25),
       %04=(ENDBEFR=C',',FIXLEN=06),
       %05=(ENDBEFR=C',',FIXLEN=08),
       %06=(ENDBEFR=C',',FIXLEN=18),
       %07=(ENDBEFR=C',',FIXLEN=10),
       %08=(ENDBEFR=C',',FIXLEN=17),
       %09=(ENDBEFR=C',',FIXLEN=17),
       %10=(ENDBEFR=C',',FIXLEN=17),
       %11=(ENDBEFR=C',',FIXLEN=17),
       %12=(ENDBEFR=C',',FIXLEN=17),
       %13=(ENDBEFR=C',',FIXLEN=17),
       %14=(ENDBEFR=C',',FIXLEN=17),
       %15=(ENDBEFR=C',',FIXLEN=17),
    %16=(ENDBEFR=C',',FIXLEN=04),
    %17=(ENDBEFR=C',',FIXLEN=04),
    %18=(ENDBEFR=C',',FIXLEN=04),
    %19=(ENDBEFR=C',',FIXLEN=04)),
 BUILD=(1,5,
    6:%01,
   21:%02,
   47:%03,
   72:%04,
   78:%05,
   86:%06,SFF,TO=ZD,LENGTH=18,
  104:%07,
  114:%08,SFF,TO=ZD,LENGTH=17,
  131:%09,SFF,TO=ZD,LENGTH=17,
  148:%10,SFF,TO=ZD,LENGTH=17,
  165:%11,SFF,TO=ZD,LENGTH=17,
  182:%12,SFF,TO=ZD,LENGTH=17,
  199:%13,SFF,TO=ZD,LENGTH=17,
  216:%14,SFF,TO=ZD,LENGTH=17,
  233:%15,SFF,TO=ZD,LENGTH=17,
    250:%16,
    254:%17,
    258:%18,
    262:%19))
/*
//CTL2CNTL DD *
  OPTION VLSHRT
  SORT FIELDS=(6,15,CH,A,262,4,CH,A)
  OUTFIL FNAMES=OUT1,
    INCLUDE=(5,1,CH,EQ,C'1',AND,6,3,CH,NE,C'>>>'),
    BUILD=(1,4,6)
  OUTFIL FNAMES=OUT2,
    INCLUDE=(5,1,CH,EQ,C'2',AND,6,3,CH,NE,C'>>>'),
    BUILD=(1,4,6)
/*
Back to top
View user's profile Send private message
suyerasi

New User


Joined: 05 Apr 2007
Posts: 38
Location: india

PostPosted: Fri Feb 27, 2009 6:09 am
Reply with quote

Dear Frank,

Thank you very much for your quick resolution on this.

Thanks
Suyerasi
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 How to split large record length file... DFSORT/ICETOOL 8
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top