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
 

 

need to get date as prefix to file name

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: need to get date as prefix to file name
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: 8593
Location: Back in jolly old England

PostPosted: Thu Oct 29, 2009 2:25 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Thu Oct 29, 2009 5:04 pm    Post subject: Reply to: need to get date as prefix to file name
Reply with quote

Here's another topic on a similar subject:

http://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    Post subject: Reply to: need to get date as prefix to file name
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    Post subject:
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    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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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