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

Use values from a file in JCL


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

New User


Joined: 09 Sep 2008
Posts: 31
Location: India

PostPosted: Wed Jan 13, 2010 3:56 am
Reply with quote

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? icon_question.gif

TIA!!
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jan 13, 2010 4:01 am
Reply with quote

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

New User


Joined: 09 Sep 2008
Posts: 31
Location: India

PostPosted: Wed Jan 13, 2010 4:10 am
Reply with quote

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

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jan 13, 2010 5:03 am
Reply with quote

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

New User


Joined: 09 Sep 2008
Posts: 31
Location: India

PostPosted: Wed Jan 13, 2010 9:56 pm
Reply with quote

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

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jan 13, 2010 10:36 pm
Reply with quote

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

New User


Joined: 09 Sep 2008
Posts: 31
Location: India

PostPosted: Wed Jan 13, 2010 10:47 pm
Reply with quote

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

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jan 13, 2010 11:08 pm
Reply with quote

Quote:
I have some queries in SYMNAMES - I guess I will be starting a new topic.


Yes, that would be best.
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 Binary File format getting change whi... All Other Mainframe Topics 5
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 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