|
|
| Author |
Message |
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 162 Location: India
|
|
|
|
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 |
|
 |
References
|
Posted: Tue Mar 25, 2008 7:17 pm Post subject: Re: OUTFIL PARSE command in SORT |
 |
|
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 3908 Location: San Jose, CA
|
|
|
|
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 |
|
 |
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 162 Location: India
|
|
|
|
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 |
|
 |
Gnanas SNG
Senior Member
Joined: 06 Sep 2007 Posts: 414 Location: India
|
|
|
|
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 |
|
 |
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 162 Location: India
|
|
|
|
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 |
|
 |
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 162 Location: India
|
|
|
|
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 |
|
 |
Moved: Wed Mar 26, 2008 12:41 pm by superk From DFSORT/ICETOOL to JCL |
Anuj D.
Senior Member
Joined: 22 Apr 2006 Posts: 1264 Location: Mumbai, India
|
|
|
|
Hi,
Joining the party pretty late...
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 |
|
 |
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 162 Location: India
|
|
|
|
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 |
|
 |
Moved: Wed Mar 26, 2008 9:12 pm by Frank Yaeger From JCL to DFSORT/ICETOOL |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 3908 Location: San Jose, CA
|
|
|
|
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 |
|
 |
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 162 Location: India
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 3908 Location: San Jose, CA
|
|
|
|
Sigh.
| 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 |
|
 |
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 183 Location: USA
|
|
|
|
| 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 |
|
 |
|
|
|