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

Writing output file based on a particular word in the input


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

New User


Joined: 05 Jan 2006
Posts: 11

PostPosted: Mon Aug 07, 2006 5:48 pm
Reply with quote

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
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Mon Aug 07, 2006 6:30 pm
Reply with quote

Do you have DFSORT insatlled at your site ???
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: Mon Aug 07, 2006 9:34 pm
Reply with quote

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
View user's profile Send private message
jjooyy

New User


Joined: 05 Jan 2006
Posts: 11

PostPosted: Tue Aug 08, 2006 2:46 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Aug 08, 2006 8:10 pm
Reply with quote

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
View user's profile Send private message
jjooyy

New User


Joined: 05 Jan 2006
Posts: 11

PostPosted: Wed Aug 16, 2006 4:08 pm
Reply with quote

Thanks a lot Frank.
Back to top
View user's profile Send private message
steve

New User


Joined: 24 Mar 2005
Posts: 16
Location: Long Island

PostPosted: Thu Aug 17, 2006 12:49 pm
Reply with quote

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
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Thu Aug 17, 2006 2:02 pm
Reply with quote

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
View user's profile Send private message
steve

New User


Joined: 24 Mar 2005
Posts: 16
Location: Long Island

PostPosted: Thu Aug 17, 2006 5:43 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu Aug 17, 2006 8:35 pm
Reply with quote

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
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
Search our Forums:

Back to Top