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
 

 

Use values from a file in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Use values from a file in JCL
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 Moderator


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

PostPosted: Wed Jan 13, 2010 4:01 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Wed Jan 13, 2010 5:03 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Wed Jan 13, 2010 10:36 pm    Post subject:
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:

http://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    Post subject:
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 Moderator


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

PostPosted: Wed Jan 13, 2010 11:08 pm    Post subject:
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    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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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