Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Writing output file based on a particular word in the input

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Writing output file based on a particular word in the input
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: 1452
Location: Chicago, IL

PostPosted: Mon Aug 07, 2006 6:30 pm    Post subject: Re: Writing output file based on a particular word in the in
Reply with quote

Do you have DFSORT insatlled at your site ???
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Mon Aug 07, 2006 9:34 pm    Post subject:
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    Post subject: Re: Writing output file based on a particular word in the in
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 Moderator


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

PostPosted: Tue Aug 08, 2006 8:10 pm    Post subject:
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    Post subject: Re: Writing output file based on a particular word in the in
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    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Aug 17, 2006 8:35 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us