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

OUTFIL PARSE command in SORT


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

Active User


Joined: 22 Jan 2008
Posts: 194
Location: India

PostPosted: Tue Mar 25, 2008 7:17 pm
Reply with quote

Has any one used OUTFIL PARSE command for CSV input file to formated out file.

trying to use the following control cards but getting message " No keywords"

Code:

//SYSIN    DD *                                     
  OUTFIL PARSE=(%01=(ENDBEFR=C',',FIXLEN=3),         
              %02=(ENDBEFR=C',',FIXLEN=5),         
              %03=(ENDBEFR=C',',FIXLEN=8),         
              %04=(ENDBEFR=C',',FIXLEN=8)),         
  BUILD=(1:%01,08:%02,20:%03,30:%04)                 
/*                                 


requirement is I got a comma-seperated input file and want to seperate the values based on the comma seperator.
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: Tue Mar 25, 2008 8:27 pm
Reply with quote

You're missing a SORT, MERGE or OPTION COPY statement so you would have gotten this error message with DFSORT:

ICE010A 0 NO SORT OR MERGE CONTROL STATEMENT

I used the DFSORT job below with an OPTION COPY statement and your OUTFIL statement and it worked fine:

Code:

//S1    EXEC  PGM=ICEMAN                           
//SYSOUT    DD  SYSOUT=*                           
//SORTIN DD *                                       
ABC,DEF,GHI,JKL                                     
//SORTOUT DD SYSOUT=*                               
//SYSIN    DD    *                                 
  OPTION COPY                                       
  OUTFIL PARSE=(%01=(ENDBEFR=C',',FIXLEN=3),       
              %02=(ENDBEFR=C',',FIXLEN=5),         
              %03=(ENDBEFR=C',',FIXLEN=8),         
              %04=(ENDBEFR=C',',FIXLEN=8)),         
  BUILD=(1:%01,08:%02,20:%03,30:%04)               
/*                                                 
Back to top
View user's profile Send private message
HappySrinu

Active User


Joined: 22 Jan 2008
Posts: 194
Location: India

PostPosted: Wed Mar 26, 2008 11:14 am
Reply with quote

Frank,
Thanks much for your code
I tried using the same code you posted but no luck still.

error message
SYSIN :
OPTION COPY
OUTFIL PARSE=(%01=(ENDBEFR=C',',FIXLEN=5),
*
%02=(ENDBEFR=C',',FIXLEN=5),
%03=(ENDBEFR=C',',FIXLEN=5),
%04=(ENDBEFR=C',',FIXLEN=5)),
BUILD=(1:%01,08:%02,20:%03,30:%04)
WER268A OUTFIL STATEMENT : SYNTAX ERROR

currently we have Z/OS V1 R7 and does this commands work on this version or V1 R8 on wards.. Just a doubt.

I used ICEMAN instead of SORT but still same above message.
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed Mar 26, 2008 11:19 am
Reply with quote

Have DFSORT been installed in your shop?
Quote:
I used ICEMAN instead of SORT but still same above message.

Whichever name you use either SORT or ICEMAN or ICETOOL, the installed Sort product will be invoked.

Please check your Job log for finding out SORT product installed...
Back to top
View user's profile Send private message
HappySrinu

Active User


Joined: 22 Jan 2008
Posts: 194
Location: India

PostPosted: Wed Mar 26, 2008 11:28 am
Reply with quote

Guess you are right.
We got SYNCSORT and thats the reason not able to run PARSE commands .

Any alternative to use similar commands in SYSNCSORT
Back to top
View user's profile Send private message
HappySrinu

Active User


Joined: 22 Jan 2008
Posts: 194
Location: India

PostPosted: Wed Mar 26, 2008 12:18 pm
Reply with quote

yes Gnanas, I tried in another lpar which have DFSORT and it worked fine with minor changes control cards.

Thanks to you and Frank for helping me
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Mar 26, 2008 1:12 pm
Reply with quote

Hi,

Joining the party pretty late... icon_smile.gif

Well, WERXXX are meant for SyncSort & ICEXXX are meant for DFSORT.

From one of your (Srinu) previous post, SYSOUT messages
Quote:
WER268A OUTFIL STATEMENT : SYNTAX ERROR

says that You use SyncSort in the respective LPAR.


Hope this helps.
Back to top
View user's profile Send private message
HappySrinu

Active User


Joined: 22 Jan 2008
Posts: 194
Location: India

PostPosted: Wed Mar 26, 2008 1:51 pm
Reply with quote

Thats a good tip Anuj, Thanks

I am facing another problem with csv input file..
My input file is CSV from one of the reports i do run to get
it's details are
DCB=(RECFM=VB,LRECL=4092,BLKSIZE=4096,DSORG=PS),

I am planing to write out put in FBA file..
DCB=(RECFM=FBA,LRECL=133,BLKSIZE=2660,DSORG=PS),


Input data :
"test id","test NAME","test NAME1","test NAME2","test ID",
"0","sri","srini","srinivas","7",

Out put should be like..
Test ID TESTNAME TEST NAME1 TEST NAME2 TEST ID
0 SRI SRINI SRINIVAS 7

when I run using control cards...

OPTION TRUNC=RC0,COPY
OUTFIL PARSE=(%01=(ENDBEFR=C',',FIXLEN=3),
%02=(ENDBEFR=C',',FIXLEN=5),
%03=(ENDBEFR=C',',FIXLEN=8),
%04=(ENDBEFR=C',',FIXLEN=8),
%05=(ENDBEFR=C',',FIXLEN=3)),
BUILD=(5:%01,10:%02,20:%03,30:%04,40:%05)

error message i am facing as shown below..
ICE201I E RECORD TYPE IS V - DATA STARTS IN POSITION 5
ICE126A 9 INCONSISTENT SORTOUT IFTHEN 0 REFORMATTING FIELD FOUND

any suggestions
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: Wed Mar 26, 2008 9:28 pm
Reply with quote

You can use a DFSORT job like the following to do what you want. However, your FIXLEN values and c: values are inconsistent with the fields you are trying to extract. For example, for %01 you have FIXLEN=3 and 5:%01,10: but since "Test ID" is 9 bytes long, that's too small for it. And if you're trying to remove the quotes, you need the correct PARSE operands to do that (e.g.

%01=(STARTAFT=C'"',ENDBEFR=C'"',FIXLEN=10),
%02=(STARTAFT=C'"',ENDBEFR=C'"',FIXLEN=10),
...

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=... input file (VBA/4092)
//SORTOUT DD DSN=...,
// RECFM=FBA,LRECL=133,BLKSIZE=2660,DSORG=PS
//SYSIN    DD    *
  OPTION TRUNC=RC0,COPY
  OUTFIL VTOF,PARSE=(%01=(ENDBEFR=C',',FIXLEN=3),
    %02=(ENDBEFR=C',',FIXLEN=5),
    %03=(ENDBEFR=C',',FIXLEN=8),
    %04=(ENDBEFR=C',',FIXLEN=8),
    %05=(ENDBEFR=C',',FIXLEN=3)),
  BUILD=(5:%01,10:%02,20:%03,30:%04,40:%05,133:X)
/*
Back to top
View user's profile Send private message
HappySrinu

Active User


Joined: 22 Jan 2008
Posts: 194
Location: India

PostPosted: Thu Mar 27, 2008 10:33 am
Reply with quote

Frank,
Thanks for your info..
I tried using same card same you given as example..

got below error

Code:

            OPTION TRUNC=RC0,COPY                                               
            OUTFIL VTOF,PARSE=(%00=(STARTAFT=C'"',ENDBEFR=C'"',FIXLEN=10),     
                               %01=(STARTAFT=C'"',ENDBEFR=C'"',FIXLEN=10),     
                               %02=(STARTAFT=C'"',ENDBEFR=C'"',FIXLEN=10),     
                               %03=(FIXLEN=10)),                               
            BUILD=(1,4,5:%00,20:%01,35:%02,50:%03)                             
ICE201I E RECORD TYPE IS V - DATA STARTS IN POSITION 5                         
ICE222A 0 59 BYTE FIXED RECORD LENGTH IS NOT EQUAL TO 133 BYTE LRECL FOR SORTOUT
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 27, 2008 8:58 pm
Reply with quote

Sigh. icon_rolleyes.gif

Quote:
I tried using same card same you given as example..


No, you didn't! If you look at my BUILD operand, you'll see it has 133:X at the end - that causes it to build the 133 byte record you said you wanted. Your BUILD operand does not have 133:X at the end so it builds a 59 byte record which conflicts with the LRECL=133 for SORTOUT. That's what the error message is telling you. You need 133:X.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Fri Mar 28, 2008 9:12 pm
Reply with quote

HappySrinu wrote:

OUTFIL PARSE=(%01=(ENDBEFR=C',',FIXLEN=5),
*
%02=(ENDBEFR=C',',FIXLEN=5),
%03=(ENDBEFR=C',',FIXLEN=5),
%04=(ENDBEFR=C',',FIXLEN=5)),
BUILD=(1:%01,08:%02,20:%03,30:%04)
WER268A OUTFIL STATEMENT : SYNTAX ERROR

PARSE is supported in SyncSort for z/OS 1.3.0.0 and later. I suspect you are running an earlier release of SyncSort on this system, causing the syntax error.
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Routing command Address SDSF to other... TSO/ISPF 2
Search our Forums:

Back to Top