View previous topic :: View next topic
|
Author |
Message |
jjooyy
New User
Joined: 05 Jan 2006 Posts: 11
|
|
|
|
Is there any options are available in JCL to write a record in to the output file based on the availability of a particular word in the input file at any position? |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Do you have DFSORT insatlled at your site ??? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
jjooyy,
It's not clear what exactly you want to do. Please show an example of the records in your input file, what you expect for output and the "rules" for getting from input to output. Also, give the RECFM and LRECL of the input file. |
|
Back to top |
|
|
jjooyy
New User
Joined: 05 Jan 2006 Posts: 11
|
|
|
|
Frank,
i have given the details regarding my query.
Record Length : Any fixed length.
INPUT FILE
rec1 111111wwwwwwwwwwwwwwwwwwwjoydffffffffffffffffff
rex2 42rmjmmmmmjoykjjjjjjjjjjjjjjjjjjjjjjjjjdfdfffff
rec3 hhhhhhhhhhhhhhhhhhsafffffffffffffffffffffffffff
rec4 wsfnkkljbfffffffffffffffadfjkblkkljblkjkljkljbf
rec5 joyjsbvhcbkjbnxkjcbnkjzcbcbcbcbcbbbbbbbbbbbbbbb
rec6 jhjjjjjjjfldskjhhhhhhhhhhhhhhhhhhhhhhhhhhhhhjoy
The word 'JOY' is present only in the records 1,2,5,6.
How can i write that(1,2,5,6) records only in output file.
Let me know if you want any further information. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT job like this to do what you asked for. Just use your LRECL for n.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (RECFM=FB,LRECL=n)
//SORTOUT DD DSN=... output file (FB/n)
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,n,SS,EQ,C'joy')
/*
|
|
|
Back to top |
|
|
jjooyy
New User
Joined: 05 Jan 2006 Posts: 11
|
|
|
|
Thanks a lot Frank. |
|
Back to top |
|
|
steve
New User
Joined: 24 Mar 2005 Posts: 16 Location: Long Island
|
|
|
|
Frank
I wrote the jcl with following statements, but I got the return code "16" (format error in the include statement). Its saying "SS" is not a valid format.. Please advise..
000003 //STEP1 EXEC PGM=ICEMAN
000004 //SYSOUT DD SYSOUT=*
000005 //SORTIN DD DSN=SRITH01.C2686350.INPUT,DISP=SHR
000006 //SORTOUT DD SYSOUT=*
000007 //SYSIN DD *
000008 OPTION COPY
000009 INCLUDE COND=(1,80,SS,EQ,C'SRI')
000010 /*
Sri- |
|
Back to top |
|
|
shreevamsi
Active User
Joined: 23 Feb 2006 Posts: 305 Location: Hyderabad,India
|
|
|
|
hi Steve,
The code provided by Frank works fine. You can't see the output in the SPOOL. Direct it into a flat file with attributes same as SORTIN.
Also check which record format is your input is??
~Vamsi |
|
Back to top |
|
|
steve
New User
Joined: 24 Mar 2005 Posts: 16 Location: Long Island
|
|
|
|
Though I specified SORTOUT=*, it took the same properties as SORTIN. I dont think that is the reason, I even tried with a data set at SORTOUT. But still same problem.. We are using CA-SORT but not IBM DF-SORT. Might be CA-SORT is not supporting this feature.. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
DFSORT supports the SS format. AFAIK, CA-SORT does not support the SS format.
I'm a DFSORT developer. DFSORT and CA-SORT are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on CA-SORT. |
|
Back to top |
|
|
|