|
View previous topic :: View next topic
|
| Author |
Message |
Time2Live
New User

Joined: 27 Apr 2005 Posts: 43 Location: United States
|
|
|
|
Looking for a way to vary an output file name (cataloging) depending on what is in an input parm.
If input parm is AAAB1 I would like the output file name to be SYSTEM.AAAB1.DATA. The input parm would vary every day.
Is there a way to use File-Manager or ICETOOLS for this please? |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1441 Location: Bamberg, Germany
|
|
|
|
| Use SYSTEM SYMBOLS in your JCL. |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2283 Location: USA
|
|
|
|
| Time2Live wrote: |
Looking for a way to vary an output file name (cataloging) depending on what is in an input parm.
If input parm is AAAB1 I would like the output file name to be SYSTEM.AAAB1.DATA. The input parm would vary every day.
Is there a way to use File-Manager or ICETOOLS for this please? |
1. How your "input parm" looks like??
2. How your "input parm" is related to the DFSORT/ICETOOL category??
3.
| Code: |
// SET INPARM='AAAB1'
// . . . . . . . .
//OUTPUT DD DISP=(NEW,CATLG),DSN=SYSTEM.&INPARM..DATA,
// . . . . |
|
|
| Back to top |
|
 |
Time2Live
New User

Joined: 27 Apr 2005 Posts: 43 Location: United States
|
|
|
|
Hi sergeyken,
I know the best way is to use a symbolic, but the 'AAAB1' (this will vary) will be in a file that the customer controls. How would I get that value from their input file into that &inparm value in the JCL?
I thought there may be a way to use ICETOOLS or FILE-Manager to read this input file and pull 'AAAB1' out and set the &inparm with that value.
| Code: |
EDIT CUST.INPUT.FILE.DATA - 01.01
Command ===>
****** ***************************** Top of Data *******
000001 BLAHBLAHBLAH AAAB1 XXXXXOTHER STUFF
****** **************************** Bottom of Data ***** |
|
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1441 Location: Bamberg, Germany
|
|
|
|
| Use a temporary PROCLIB, from there you can include the member with the settings. Guess that will work. |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2283 Location: USA
|
|
|
|
| Time2Live wrote: |
Hi sergeyken,
I know the best way is to use a symbolic, but the 'AAAB1' (this will vary) will be in a file that the customer controls. How would I get that value from their input file into that &inparm value in the JCL?
I thought there may be a way to use ICETOOLS or FILE-Manager to read this input file and pull 'AAAB1' out and set the &inparm with that value.
| Code: |
EDIT CUST.INPUT.FILE.DATA - 01.01
Command ===>
****** ***************************** Top of Data *******
000001 BLAHBLAHBLAH AAAB1 XXXXXOTHER STUFF
****** **************************** Bottom of Data ***** |
|
In those cases I use two-steps approach: 0) create the required dataset with a typical unique name, like
| Code: |
| //REALDATA DD DISP=(NEW,CATLG),...,DSN=SYSTEM.$STD.DATA |
1) use any text-processing tool (I prefer SORT utility, but many options are available) - to generate, in a temporary DSN=&&ALTER, the statements (for IDCAMS, or other tool) - to rename the initial DSN to the required one -
| Code: |
| ALTER SYSTEM.$STD.DATA NEWNAME( SYSTEM.AAAB1.DATA ) |
2) run IDCAMS (or any other utility) using the dynamically generated statement(s) from #1 as the utility's input:
| Code: |
//RENAME EXEC PGM=IDCAMS
// . . . . . . .
//SYSIN DD DISP=(OLD,DELETE),DSN=&&ALTER |
P.S.
All JCL SET-variables are resolved before job execution begins.
There is no way to change any SET-value while the job is running.
Same as macro-variables in some languages.
In C++ you cannot change MAX_VALUE which was defined as:
#define MAX_VALUE 100000 |
|
| Back to top |
|
 |
Time2Live
New User

Joined: 27 Apr 2005 Posts: 43 Location: United States
|
|
|
|
Thank You sergeyken! The IDCAMS/ALTER/NEWNAME worked Great! Really appreciate  |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2283 Location: USA
|
|
|
|
Depending on your input parameters data, the operation can be hidden into a JCL PROC:
// EXEC RENAME,HLQ=SYSTEM,LLQ=DATA
//SORTIN DD DSN=SYSTEM.INPUT.PARAMS : 'xxxxx $STD xxxxx AAAB1 xxxxx'
//*
| Code: |
//RENAME PROC HLQ='SYSTEM',LLQ='DATA'
//*===========================================
//GENALTER EXEC PGM=SORT,COND=(4,LT)
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=NULLFILE dummy template
//SORTOUT DD DISP=(NEW,PASS),SPACE=(TRK,(1,1)),LRECL=80,
// DSN=&&ALTER
//SYSIN DD *,SYMBOLS=EXECSYS
* Any input format like: old_id new_id
INREC PARSE=(%01=(STARTAFT=...,
ENDBEFR=...,
FIXLEN=8),
%02=(STARTAFT=...,
ENDBEFR=...,
FIXLEN=8)),
BUILD=(1:C'&HLQ..',%01,C'.&LLQ',80:X,
81:C'&HLQ..',%02,C'.&LLQ',160:X)
SORT FIELDS=COPY,STOPAFT=1
OUTREC BUILD=(1,80,SQZ=(SHIFT=LEFT),
81,80,SQZ=(SHIFT=LEFT))
OUTFIL BUILD=(C' ALTER ',1,44,C' -',80:X,
/,C' NEWNAME( ',81,44,С' )',80:X)
//*
//*===========================================
//ALTER EXEC PGM=IDCAMS,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DISP=(OLD,DELETE),DSN=&&ALTER
//*
//*===========================================
//RENAME PEND
|
|
|
| Back to top |
|
 |
Time2Live
New User

Joined: 27 Apr 2005 Posts: 43 Location: United States
|
|
|
|
Yes! I see! That sounds good too!  |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|