View previous topic :: View next topic
|
Author |
Message |
janusman
New User
Joined: 09 Sep 2008 Posts: 31 Location: India
|
|
|
|
Hi
I have a file (FB, LRECL=80) with only one record in the following layout.
Report-ID - 12 ch
Space - 1 ch
Jobname - 8 ch
Space - 1 ch
Generation# - 5 ch
Space - 1 ch
Sequence# - 4 ch
E.g
JOB12345-R12 JOB13245 NNNNN nnnn
My requirement is to extract the data from the above file and use Report-ID, Generation# and Sequence# in SARBCH utility to backup data.
I understand that these values have to be passed in SYSIN and I cannot use symbolics in SYSIN parameter.
Is there any way to achieve this?
TIA!! |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use DFSORT to generate the control statements you need with the extracted fields as a "SYSIN" data set, and pass that SYSIN data set to SARBCH.
I can't tell you more than that unless/until you show exactly what the SARBCH control statements should look like. |
|
Back to top |
|
|
janusman
New User
Joined: 09 Sep 2008 Posts: 31 Location: India
|
|
|
|
Frank
The SARBCH control statement should look like this.
Code: |
/DBASE NAME=CAVIEW.SAR
/LOAD ID=JOB12345 GEN=NNNNN DDNAME=LISTOUT1 SEQ=nnnn |
Where
LISTOUT1 is the output dataset that I will be using to backup the data.
NNNNN - is the Generation#
nnnn- is the sequence#
Thanks. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Hmmm ... you say you want to use the Report ID, but that's 12 chars in the input file and you show 8 characters in the output file, so I assumed you only want positions 1-8 there. Here's a DFSORT job that will create a temporary data set with the control statements you asked for.
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//SORTOUT DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
HEADER1=('/DBASE NAME=CAVIEW.SAR',/,
'/LOAD ID=',1,8,' GEN=',23,5,' DDNAME=LISTOUT1 SEQ=',29,4)
/*
|
|
|
Back to top |
|
|
janusman
New User
Joined: 09 Sep 2008 Posts: 31 Location: India
|
|
|
|
Frank
Thanks - Sorry for the confusion. I will adjust the code accordingly.
I have one more question here.
In the above code - we have 5 bytes for GEN#. Lets say I have only 4bytes with numbers and the last byte is spaces, will this still work ?
I guess it depends on if it will work when there are spaces in control card of SARBCH. I will try and let you know what is happening.
Thanks again. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
If you want to make sure that GEN# comes out as 5 digits, you can add this INREC statement:
Code: |
INREC OVERLAY=(23:23,5,UFF,TO=ZD,LENGTH=5)
|
This will convert (b for blank)
Code: |
12345 to 12345
1234b to 01234
123bb to 00123
12bbb to 00012
1bbbb to 00001
|
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080 |
|
Back to top |
|
|
janusman
New User
Joined: 09 Sep 2008 Posts: 31 Location: India
|
|
|
|
Thanks Frank. I figured this out. Thanks to the tutorials I got from this forum.
I have some queries in SYMNAMES - I guess I will be starting a new topic. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
I have some queries in SYMNAMES - I guess I will be starting a new topic. |
Yes, that would be best. |
|
Back to top |
|
|
|