Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us