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 of JCL to append a record in Output file.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
krunalbafna
Warnings : 1

Active User


Joined: 18 Jan 2010
Posts: 143
Location: Pune

PostPosted: Mon Jan 09, 2012 3:13 pm    Post subject: Use of JCL to append a record in Output file.
Reply with quote

Hi,
I have following idea in mind:
I have a input file having value as
001datasetname.
The input file is having 14 entries.
I shall pass using parm value "001,002 depending upon the dataset name i want to access".
The dataset name shall be appeneded in the another input file at the end which is having some data.

Is it possible to work out the idea.

Regards,
Krunal Bafna
Telephone number removed by moderator
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Jan 09, 2012 3:29 pm    Post subject: Reply to: Use of JCL to append a record in Output file.
Reply with quote

You have ignored the advice to remove your telephone number. The consequences are yous.

To the question.

Probably. Probably not exactly how you think you want it from your description.

You can code the extract from a parameter? I'd read the other input/output file and add the extracted record as the last, rather than try anything with DISP=MOD, but it seems straightforward.

Go to it!
Back to top
View user's profile Send private message
krunalbafna
Warnings : 1

Active User


Joined: 18 Jan 2010
Posts: 143
Location: Pune

PostPosted: Mon Jan 09, 2012 3:44 pm    Post subject:
Reply with quote

using Jcl is it not possible to do, if we remove parm, we hardcode the value of the dataset name using OUTREC parameter to be written into the output file.

The input file data + dataset name(as last record)

Input file data:
Your request processed succesffully. kindly refer below dataset name:
"Name of the dataset".

Regards,
Krunal
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Jan 09, 2012 4:25 pm    Post subject: Reply to: Use of JCL to append a record in Output file.
Reply with quote

JCL can do no data manipulation of any sort.

Programs which are specified to run, by JCL, can manipulate data.

If you have a program/utilitiy which can take a parm and extract a record from a file/dataset which matches that parm at a particular position, then you have a start.

Conceptually you want to stick that record on the back of another file.

I'm saying I'd read/write the other file, then, when the other file is compilete, I'd add the extracted record.

The other way would be with DISP=MOD but you'd need some "restore" logic in case your adding step needed to be run again.

Usually when people expect JCL to do things for them it turns out that they mean their Sort product. Is that the case here? If so, which sort product do you have?
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Jan 09, 2012 4:37 pm    Post subject:
Reply with quote

I've hard time in understanding your requirement. Suggest you please post some sample input records, expected output from them and the LRECL/RECFM of both input and output.
Back to top
View user's profile Send private message
krunalbafna
Warnings : 1

Active User


Joined: 18 Jan 2010
Posts: 143
Location: Pune

PostPosted: Mon Jan 09, 2012 5:17 pm    Post subject:
Reply with quote

I/P file 1: Content:

THE INPUT FILE PROVIDED PROCESSED SUCCESSFULLY.


REFER THE BELOW DATASET NAME:

The OUTPUT FILE SHOULD HAVE:
THE INPUT FILE PROVIDED PROCESSED SUCCESSFULLY.


REFER THE BELOW DATASET NAME:
ABC.INDIA.LOVAAA.BANMUM

THE DATASET NAME SHOULD BE APPENDED AT THE END. IS IT POSSIBLE TO WRITE THE JCL.
There are fourteen different dataset which should be sleceted based on some condition.

One option i have is to cretate 14 different cards and use the above message.

But i am thinking of dynamic option selection and only through JCL if possible.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Jan 09, 2012 5:28 pm    Post subject: Re: Reply to: Use of JCL to append a record in Output file.
Reply with quote

Bill Woodger wrote:
JCL can do no data manipulation of any sort.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Jan 09, 2012 5:36 pm    Post subject:
Reply with quote

If this is the answer you think suffies to what I've asked for, I leave it to others to chip in here to get you going!
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1218
Location: Israel

PostPosted: Mon Jan 09, 2012 6:55 pm    Post subject: Reply to: Use of JCL to append a record in Output file.
Reply with quote

Code:
//STEP01     EXEC PGM=SYNCSORT
//SYSPRINT DD   SYSOUT=*
//SYSOUT   DD   SYSOUT=*
//SORTIN   DD   *
001HLQ.FILE.NAME1
002HLQ.FILE.NAME2
003HLQ.FILE.NAME3
004HLQ.FILE.NAME4
005HLQ.FILE.NAME5
//SORTOUT  DD   SYSOUT=*
//SYSIN    DD   *
  INCLUDE COND=(1,3,CH,EQ,C'004')
  SORT    FIELDS=COPY
  OUTFIL  REMOVECC,
          HEADER1=(C'THE INPUT FILE PROVIDED PROCESSED SUCCESSFULLY.'),
          HEADER2=(C'REFER THE BELOW DATASET NAME:'),
          OUTREC=(4,60)

That should give you part of the solution...
Can you manage from here ?
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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