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

need to get date as prefix to file name


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

New User


Joined: 25 Jun 2008
Posts: 60
Location: chennai

PostPosted: Thu Oct 29, 2009 2:16 pm
Reply with quote

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

Global Moderator


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

PostPosted: Thu Oct 29, 2009 2:25 pm
Reply with quote

/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
View user's profile Send private message
pradeepkit
Warnings : 1

New User


Joined: 25 Jun 2008
Posts: 60
Location: chennai

PostPosted: Thu Oct 29, 2009 3:04 pm
Reply with quote

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

Senior Member


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

PostPosted: Thu Oct 29, 2009 3:21 pm
Reply with quote

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
View user's profile Send private message
pradeepkit
Warnings : 1

New User


Joined: 25 Jun 2008
Posts: 60
Location: chennai

PostPosted: Thu Oct 29, 2009 3:27 pm
Reply with quote

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

Senior Member


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

PostPosted: Thu Oct 29, 2009 3:41 pm
Reply with quote

How to identify the position to insert DATE field?
Back to top
View user's profile Send private message
pradeepkit
Warnings : 1

New User


Joined: 25 Jun 2008
Posts: 60
Location: chennai

PostPosted: Thu Oct 29, 2009 3:44 pm
Reply with quote

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

Senior Member


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

PostPosted: Thu Oct 29, 2009 3:56 pm
Reply with quote

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
View user's profile Send private message
pradeepkit
Warnings : 1

New User


Joined: 25 Jun 2008
Posts: 60
Location: chennai

PostPosted: Thu Oct 29, 2009 3:59 pm
Reply with quote

if we will suffix it instead of prefixing then can you please let me know how it can be done...
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Oct 29, 2009 4:32 pm
Reply with quote

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
View user's profile Send private message
pradeepkit
Warnings : 1

New User


Joined: 25 Jun 2008
Posts: 60
Location: chennai

PostPosted: Thu Oct 29, 2009 4:35 pm
Reply with quote

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

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Oct 29, 2009 5:04 pm
Reply with quote

Here's another topic on a similar subject:

www.ibmmainframes.com/viewtopic.php?t=29170

maybe it might be of use.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Oct 29, 2009 9:02 pm
Reply with quote

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
View user's profile Send private message
pradeepkit
Warnings : 1

New User


Joined: 25 Jun 2008
Posts: 60
Location: chennai

PostPosted: Fri Oct 30, 2009 8:21 am
Reply with quote

Hi Skolusu,

Thanks for the solution.

thanks a lot
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top