View previous topic :: View next topic
|
Author |
Message |
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
I have input file as
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
What has this to do with JCL ?
Yes, lots of ways of doing it. Any particular method that appeals to you ? |
|
Back to top |
|
|
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
Using Simple SORT programming |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
SYNCSORT, DFSORT or CA-SORT |
|
Back to top |
|
|
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
DFSORT |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
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 |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Your whole post is confusing..
You are saying you want to add some lines before and after but adding only one before and after....
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... |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
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 |
|
|
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
Can anyone suggest |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
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 |
|
|
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
Can u suggest how it can be done in REXX |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
Back to top |
|
|
|