View previous topic :: View next topic
|
Author |
Message |
jaguyria
New User
Joined: 15 Feb 2022 Posts: 21 Location: Portugal
|
|
|
|
Hello,
I need to create a step to transfer a cobol file throw CFT with a specific name.
The file transferred must be named with a Date IN (char(8) that is in the cobol file) and the timestamp of the transfer.
NB: The parameter Date is on the position 1 to 8 (2nd line) of F0.INPUT.FILE
I thought using de PROC=CFTREQB:
Code: |
//ENV001 EXEC PROC=CFTREQB
//CFTIN DD *
SEND FNAME=F0.INPUT.FILE
PART=TRF01,IDF=ABCDEF
NFNAME=F0..&DATEIN..&FDATE..&FTIME
FCODE=EBCDIC,
NCODE=EBCDIC
/* |
Regarding the manuals the parameters &FDATE, &FTIME must work using the NFNAME (https://docs.axway.com/bundle/TransferCFT_36_UsersGuide_allOS_en_HTML5/page/Content/CFTUTIL/Parameter_index/nfname.htm)
But how can I extract the date of the file into variable &DATEIN?
Does anyone have an idea?
Thanks in advance! |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Easy, you'll need a step that runs prior to the CFT step that will read the input dataset (F0.INPUT.FILE) and extract the date value as required. It would then build the required NFNAME statement as needed, and then pass that to the input of the CFT step. |
|
Back to top |
|
|
jaguyria
New User
Joined: 15 Feb 2022 Posts: 21 Location: Portugal
|
|
|
|
Can you please be more specific about the step?
How can I extract the date value so easily? |
|
Back to top |
|
|
jaguyria
New User
Joined: 15 Feb 2022 Posts: 21 Location: Portugal
|
|
|
|
Hello superk,
Maybe I wasn't too clear.
I'll give you the following example:
In the input file (F0.INPUT.FILE) I have:
20220430blablabla
(...)
And I must generate the output dataset as
F0.20220430.20220902.1930
<=>
F0..&DATEIN..&FDATE..&FTIME
So I need to extract from the input file the date 20220430 into the exterior variable &DATEIN
How can I do it? Maybe is too easy for those who works with JCL daily (but it's not my case)..
Kind regards. Thanks for your time! |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 740 Location: Denmark
|
|
|
|
You can't, JCL variables are substituted as part of the job initialization (except condcode vars of course).
This have discussed before, as I recall a couple of solutions were suggested:
- Have your program build and submit a separate job.
- Use dynamic allocation to allocate the new dataset, perhaps in a separate step. This could fairly easy be done in REXX, but dynamic allocation through BPXWDYN is also availabe for COBOL if you prefer that. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
You might also use a DFSORT step to read the file and generate the required control card(s). This could be ahead of invoking your procedure or be a new step in the procedure.
The question is about the control card, not JCL or VSAM, imho.
Garry. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2154 Location: USA
|
|
|
|
jaguyria wrote: |
Hello superk,
Maybe I wasn't too clear.
I'll give you the following example:
In the input file (F0.INPUT.FILE) I have:
20220430blablabla
(...)
And I must generate the output dataset as
F0.20220430.20220902.1930
<=>
F0..&DATEIN..&FDATE..&FTIME
So I need to extract from the input file the date 20220430 into the exterior variable &DATEIN
How can I do it? Maybe is too easy for those who works with JCL daily (but it's not my case)..
Kind regards. Thanks for your time! |
1. Please, first of all learn how to use the Code button when posting your questions:
Code: |
F0.20220430.20220902.1930
<=>
F0..&DATEIN..&FDATE..&FTIME |
2. There is no such thing in this world as "exterior variable &DATEIN". Not at all. Period.
3. You need to extract some data from your input, and to substitute those data into your output (which you may use later as control statements for your FTP utility).
There are thousands various tools in this world to do this task. The only two things not suitable for that are, JCL and VSAM. Try to choose a suitable tool out of thousands of available ones, which you are familiar with.
4. The intensity of "working with JCL daily" has no relation to the ability of conversion data from one input dataset to another output dataset. Those two tasks are on different planets. |
|
Back to top |
|
|
jaguyria
New User
Joined: 15 Feb 2022 Posts: 21 Location: Portugal
|
|
|
|
Ok, thanks for your help, I'll continue doing my search. |
|
Back to top |
|
|
|