View previous topic :: View next topic
|
Author |
Message |
pradeepkit Warnings : 1 New User
Joined: 25 Jun 2008 Posts: 60 Location: chennai
|
|
|
|
Hi,
I have a reuirement:
1. to read a control card
2.copy first line as it is
3.in the second line i have a file name. i need to prefix it with the todays' date
4.then copy rest of the line as it is.
ex :
cd folder name
put 'gdg name ' filename.txt
close
quit
output
cd folder name
put 'gdg name' yyyymmdd.filename.txt
close
quit
please help me out how i can do this thru JCL or Sort.
Thanks
Pradeep |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
/RANT ON
Once more let us clarify exactly what JCL is.
it is Job Control Language.
By itself it does nothing. It is used to invoke the chosen program and to define which datasets are to be used by the DD names associated with the chosen program.
JCL does not have magical powers that solve all problems, JCL is merely the vehicule for telling the processor which program you want it to execute.
/RANT OFF
So, if you might just care to tell us which sort product you wish the JCL to execute, we might be able to help you. It is important that you state which sort product is being used as the solution may vary from product to product and it is unfair for someone using a different product to waste time giving a solution for a product that you do not use. |
|
Back to top |
|
|
pradeepkit Warnings : 1 New User
Joined: 25 Jun 2008 Posts: 60 Location: chennai
|
|
|
|
Thanks Expat for quick response.
really sorry for not giving the exact requirement.
I am using DFSORT.
Is it possible to do it with the SORT. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Quote: |
1. to read a control card
2.copy first line as it is
3.in the second line i have a file name. i need to prefix it with the todays' date
4.then copy rest of the line as it is.
|
Show us the sample controlcard to be used as input (Please use code tag)
Also in what format you want the date to be put? |
|
Back to top |
|
|
pradeepkit Warnings : 1 New User
Joined: 25 Jun 2008 Posts: 60 Location: chennai
|
|
|
|
Hi Sambhaji,
please find the sample input control card:
cd outgoing
PUT 'GNSP.NONX.GNS437.GNS43702(0)' Unicare_CSV.XLS
CLOSE
QUIT
sample output:
cd outgoing
PUT 'GNSP.NONX.GNS437.GNS43702(0)' 20091029.Unicare_CSV.XLS
CLOSE
QUIT
Date format : YYYYMMDD |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
How to identify the position to insert DATE field? |
|
Back to top |
|
|
pradeepkit Warnings : 1 New User
Joined: 25 Jun 2008 Posts: 60 Location: chennai
|
|
|
|
Hi Sambhaji,
we can fix a position that is not a problem. can we get it at 43 column?
we will follow this standard for all then.
Thanks. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
No It can't be.
It looks like you want to prefix Unicare_CSV.XLS with YYYYMMDD.
which will be after dataset name. |
|
Back to top |
|
|
pradeepkit Warnings : 1 New User
Joined: 25 Jun 2008 Posts: 60 Location: chennai
|
|
|
|
if we will suffix it instead of prefixing then can you please let me know how it can be done... |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
PUT 'GNSP.NONX.GNS437.GNS43702(0)' 20091029.Unicare |
recently in another topic, it was mentioned that using relative (+1) etc...
will not work in control cards, because the dataset name in the control cards can not be resolved.
you are going to have to use 'real' gdg dsn. |
|
Back to top |
|
|
pradeepkit Warnings : 1 New User
Joined: 25 Jun 2008 Posts: 60 Location: chennai
|
|
|
|
Hi,
We are using this control card for the purpose of FTP so there are not any issue with the relative generation mentioning in the control card.
this control card is the working one and we are not facing any issues. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
pradeepkit,
The following DFSORT JCL will give you the desired results. The job will scan for )' (hex value 5d7d40) in the put statement and then append the current date next to it
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
CD OUTGOING
PUT 'GNSP.NONX.GNS437.GNS43702(0)' UNICARE_CSV.XLS
CLOSE
QUIT
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFOUTLEN=80,
IFTHEN=(WHEN=(1,3,CH,EQ,C'PUT'),
PARSE=(%01=(STARTAT=C'PUT',ENDAT=X'5D7D40',FIXLEN=50),
%02=(FIXLEN=30)),
OVERLAY=(81:%01,DATE1,C'.',%02,01:80,89,SQZ=(SHIFT=LEFT,MID=C' ')))
/* |
|
|
Back to top |
|
|
pradeepkit Warnings : 1 New User
Joined: 25 Jun 2008 Posts: 60 Location: chennai
|
|
|
|
Hi Skolusu,
Thanks for the solution.
thanks a lot |
|
Back to top |
|
|
|