Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Add the name in the PS file and create the file dynamically

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
dharmaraok

New User


Joined: 10 Mar 2011
Posts: 45
Location: india

PostPosted: Wed Apr 01, 2020 10:43 am    Post subject: Add the name in the PS file and create the file dynamically
Reply with quote

I have an input file and it contains only country code in the file.

Input file Data:-
IN

I need to create a PS file with Country Code name.

output file :-
TESTPRD.IN.DHARMA.T123#1.CBAI1234


// UNIT=SYSDA,

// DISP=(NEW,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=800,DSORG=PS),
// SPACE=(1,(50,50),RLSE)

If the file contains Country code as "SR" then output file should create as

output file :-
TESTPRD.SR.DHARMA.T123#1.CBAI1234

Could you please let me know how can it be acheived.
Back to top
View user's profile Send private message

Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 336
Location: Bamberg, Germany

PostPosted: Wed Apr 01, 2020 10:49 am    Post subject:
Reply with quote

What have you tried so far?
Back to top
View user's profile Send private message
dharmaraok

New User


Joined: 10 Mar 2011
Posts: 45
Location: india

PostPosted: Wed Apr 01, 2020 10:54 am    Post subject: Reply to: Add the name in the PS file and create the file dynamically
Reply with quote

I have tried with Inrec build but it is not working. Could you please help me out
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 336
Location: Bamberg, Germany

PostPosted: Wed Apr 01, 2020 10:57 am    Post subject:
Reply with quote

Show some code of what you have tried.
Back to top
View user's profile Send private message
dharmaraok

New User


Joined: 10 Mar 2011
Posts: 45
Location: india

PostPosted: Wed Apr 01, 2020 12:51 pm    Post subject: Reply to: Add the name in the PS file and create the file dynamically
Reply with quote

Ihave used the below code:

Input file:-
ATEST.INPUT.SW

data in input file:-
IN

//JS010 EXEC PGM=SORT
//SORTIN DD DSN=ATEST.INPUT.SW,DISP=SHR
//OUTDD DD DSN=&&TEMP,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(1,1),RLSE),
// UNIT=(SYSDA,30),
// DCB=(RECFM=FB,LRECL=800,BLKSIZE=0,DSORG=PS)
//*
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(100,50),RLSE)
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(100,50),RLSE)
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(100,50),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSDUMP DD SYSOUT=*
//*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC BUILD=(1:C'A123PRD.',9,2,12:C'.SWOOSH.CBC#1.CBAIFB2B')
OUTFIL FNAMES=OUTDD,VTOF
/*
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1090
Location: Dublin, Ireland

PostPosted: Wed Apr 01, 2020 1:49 pm    Post subject:
Reply with quote

You said you tried with INREC BUILD but then show:

Code:
 SORT FIELDS=COPY
 OUTREC BUILD=(1:C'A123PRD.',9,2,12:C'.SWOOSH.CBC#1.CBAIFB2B')
 OUTFIL FNAMES=OUTDD,VTOF


Your should use code tags for your example.
Your job has no //SORTOUT DD statement.
It looks like you expect output in a temporay dataset - //OUTDD - but don't tell SORT this.
You have both OUTREC and OUTFIL - only one should be used.
Constants in your BUILD control card don't match your stated requirements.
You will not find 'IN' in positions 9,2 of the input file.
This approach will not dynamically create the dataset.
Is today's date significant?

Garry
Back to top
View user's profile Send private message
dharmaraok

New User


Joined: 10 Mar 2011
Posts: 45
Location: india

PostPosted: Wed Apr 01, 2020 1:59 pm    Post subject: Reply to: Add the name in the PS file and create the file dynamically
Reply with quote

Could you please help me out with JCL with the given requirements.
Its a little bit urgent
Back to top
View user's profile Send private message
Apoorva

New User


Joined: 28 Jan 2020
Posts: 47
Location: India

PostPosted: Wed Apr 01, 2020 3:00 pm    Post subject: Re: Reply to: Add the name in the PS file and create the file dynamically
Reply with quote

dharmaraok wrote:
Could you please help me out with JCL with the given requirements.
Its a little bit urgent


Review the below link to allocate a dataset using IDCAMS. But you need to figure out a way to create the SYSIN card, dynamically for IDCAMS, with the new datasetname.

https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.idai200/da6i2044.htm
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2418
Location: Hampshire, UK

PostPosted: Wed Apr 01, 2020 3:53 pm    Post subject: Reply to: Add the name in the PS file and create the file dynamically
Reply with quote

1) Use code tags when posting data, code
2) Search - this has been answered before
3) Do you want JCL or sort control statements? they are not the same.
4) If you need urgent then pay a consultant - people responding on forums do so for free, in their own time, and as and when they want - if they want to.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 857
Location: Maryland

PostPosted: Wed Apr 01, 2020 11:36 pm    Post subject:
Reply with quote

Garry Carroll wrote:
You have both OUTREC and OUTFIL - only one should be used.


Both can be used, easily. (Of course, when needed)
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 Hex Value - vb file replace old date ... premnath DFSORT/ICETOOL 10 Sat Oct 17, 2020 3:15 am
No new posts Related to using a file in comparison Kumar Sandeep JCL & VSAM 4 Fri Oct 16, 2020 5:30 pm
No new posts Creating a single-record file with CO... Joerg.Findeisen DFSORT/ICETOOL 8 Tue Oct 06, 2020 8:19 pm
No new posts Altering output file attributes f8ful All Other Mainframe Topics 5 Tue Oct 06, 2020 4:07 pm
No new posts TWS - ETT File triggering does not wo... me00266 IBM Tools 4 Mon Sep 07, 2020 11:58 pm

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