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

How to add comments


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

New User


Joined: 06 May 2008
Posts: 96
Location: Delhi

PostPosted: Thu Sep 24, 2009 3:16 pm
Reply with quote

I have input file as

Code:

ABC.PDS


I want output like

Code:

This is the input
ABC.PDS
Please use this




How Can I include lines before and after that.

Can u suggest some way to do that
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Sep 24, 2009 3:19 pm
Reply with quote

What has this to do with JCL ?

Yes, lots of ways of doing it. Any particular method that appeals to you ?
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 96
Location: Delhi

PostPosted: Thu Sep 24, 2009 3:21 pm
Reply with quote

Using Simple SORT programming
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Sep 24, 2009 3:22 pm
Reply with quote

SYNCSORT, DFSORT or CA-SORT
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 96
Location: Delhi

PostPosted: Thu Sep 24, 2009 3:25 pm
Reply with quote

DFSORT
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Sep 24, 2009 4:17 pm
Reply with quote

Code:

//DFSORT   EXEC PGM=SORT             
//SYSOUT   DD SYSOUT=*               
//SORTIN   DD *                       
Comment                               
//         DD DSN=WHATEVER,DISP=SHR   
//         DD *                       
Another comment
/*
//SORTOUT  DD DSN=WHATEVER.OUT,DISP= 
//SYSIN    DD *                       
  SORT     FIELDS=COPY               
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Sep 24, 2009 4:20 pm
Reply with quote

Hi,

try this
Code:
//STEP0001 EXEC  PGM=SORT                 
//SYSOUT   DD SYSOUT=*                     
//SORTIN   DD *                           
ABC.PDS                                   
//SORTOUT  DD SYSOUT=*                     
//SYSIN    DD *                           
  OPTION COPY                             
  OUTFIL REMOVECC,                         
  HEADER1=('This is the input'),           
   TRAILER1=('Please use this')           
/*                                         


Gerry
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 96
Location: Delhi

PostPosted: Thu Sep 24, 2009 5:07 pm
Reply with quote

If I have some lines in PS

Code:

nandlnmdl
adlnmd
dnmaldlmABC.INDUSTRY.TAKE
dlnmdn


I want to capture PDS name (ABC.INDUSTRY.TAKE) and attach it with words
DSN DD= ABC.INDUSTRY.TAKE

And I want to add some lines before this DSN line and some lines after that line.





Code:

Hi hw r u
hii
DSN DD= ABC.INDUSTRY.TAKE
bye
take care




I have used this logic


Code:

    OPTION COPY                         
    INCLUDE COND=(52,6,CH,EQ,C'EMPLEE')
    OUTFIL REMOVECC,                   
    HEADER1=('THIS IS THE INPUT'),     
     TRAILER1=('PLEASE USE THIS')       
/*   
                                 


Can u plzz suggest
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Sep 24, 2009 5:58 pm
Reply with quote

Your whole post is confusing..
You are saying you want to add some lines before and after but adding only one before and after.... icon_question.gif
Quote:

Hi hw r u
hii
DSN DD= ABC.INDUSTRY.TAKE
bye
take care

This is sample output you have shown you wanted.. but your code is writing something else... icon_question.gif
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Sep 24, 2009 6:17 pm
Reply with quote

If you have only one record satisfying condition then you can use below also...
Code:

//STEP010 EXEC PGM=SORT                                       
//DFSMSG  DD SYSOUT=*                                         
//SYSPRINT DD SYSOUT=*                                         
//SYSOUT DD SYSOUT=*                                           
//SORTIN DD *                                                 
nandlnmdl                                                     
adlnmd                                                         
dnmaldlmABC.INDUSTRY.TAKE                          EMPLEE     
dlnmdn                                                         
/*                                                             
//SORTOUT DD SYSOUT=*                                         
//SYSIN DD *                                                   
  OPTION COPY                                                 
  INCLUDE COND=(52,6,CH,EQ,C'EMPLEE')                         
  OUTFIL REMOVECC,                                             
  BUILD=(C'THIS IS THE INPUT',/,1,80,/,C'PLEASE USE THIS')     
/*                                                             
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 Sep 24, 2009 9:09 pm
Reply with quote

scorp,

You can use a DFSORT job something like the following to do what you asked for:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
nandlnmdl
adlnmd
dnmaldlmABC.INDUSTRY.TAKE                          EMPLEE
dlnmdn
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INCLUDE COND=(52,6,CH,EQ,C'EMPLEE')
  OUTFIL REMOVECC,
   BUILD=(C'Hi hw r u',/,C'hii',/,
    C'DSN DD=',9,20,/,
    C'bye',/,C'take care')
/*


SORTOUT would have:

Code:

Hi hw r u                   
hii                         
DSN DD=ABC.INDUSTRY.TAKE     
bye                         
take care                   


If that doesn't do what you want, then you need to explain in more detail what you want to do with a better example of input and output.

In the future, please try to state your requirement more clearly with a good example of input and output.
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 96
Location: Delhi

PostPosted: Fri Sep 25, 2009 10:45 am
Reply with quote

I want to dynamicaly use file , So I have done processing and I am using sort condition to get that file name.
I wan to add some details before that like

Code:

//DSVQA JOB (META0014),'SORT COMNT',CLASS=A,         
//  MSGCLASS=H,NOTIFY=&SYSUID,MSGLEVEL=(1,1)             
//DFSORT   EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DSN=DSVQ.SAR.PULL.OUT,DISP=SHR         
//SORTOUT  DD DSN=DSVQ.SAR.PULL.OUT1,DISP=(OLD,CATLG),
//          SPACE=(CYL,(1,1),RLSE),UNIT=SYSDA,           
//          DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)         
//SYSIN    DD *                                         
    OPTION COPY                                         
    INCLUDE COND=(52,6,CH,EQ,C'EMPLEE')                 


I want to add

Code:

//STEP01  EXEC PGM=VP8140                   
//STEPLIB DD  DSN=NDVR.STAGED.LOADBAT,DISP=SHR
//        DD  DSN=NDVR.PROD.LOADBAT,DISP=SHR 




So that output should be something like
Code:

//STEP01  EXEC PGM=VP8140                   
//STEPLIB DD  DSN=NDVR.STAGED.LOADBAT,DISP=SHR
//        DD  DSN=NDVR.PROD.LOADBAT,DISP=SHR 
//        DSN NAME FROM SORT CONDITION



Can u suggest
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 96
Location: Delhi

PostPosted: Fri Sep 25, 2009 4:08 pm
Reply with quote

Can anyone suggest
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Sep 25, 2009 4:20 pm
Reply with quote

Quote:
Can anyone suggest

Have patience...

What you want to achieve can be done in rexx.

In rexx identify the dataset name from your input

Change the JCL member with desired steplib and submit it.
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 96
Location: Delhi

PostPosted: Fri Sep 25, 2009 5:31 pm
Reply with quote

Can u suggest how it can be done in REXX
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Sep 25, 2009 10:12 pm
Reply with quote

Hello,

Does this translate that you want someone to write the code for you?

Suggest you put together code to do as Sambhaji suggests and post back here when there are questions/problems.

There are multiple rexx examples in the forum and you can get most of what you want with only a little bit of effort. . .
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Sep 25, 2009 11:34 pm
Reply with quote

I am out of office now so cant post code. but below posts will certainly help you

Edit dataset
ibmmainframes.com/viewtopic.php?t=44029

Submit jcl in rexx
www.ibmmainframes.com/about9873.html
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
This topic is locked: you cannot edit posts or make replies. Adding comments in Synsort SYNCSORT 18
No new posts Comments on the right of instructions... IBM Tools 1
No new posts Find Comments in cobol by user /system COBOL Programming 20
No new posts Tool for moving cobol comments to nex... CLIST & REXX 6
No new posts Comments in Connect Direct Sysin All Other Mainframe Topics 2
Search our Forums:

Back to Top