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

Add the name in the PS file and create the file dynamically


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Senior Member


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

PostPosted: Wed Apr 01, 2020 10:49 am
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
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

Senior Member


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

PostPosted: Wed Apr 01, 2020 10:57 am
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
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: 1193
Location: Dublin, Ireland

PostPosted: Wed Apr 01, 2020 1:49 pm
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
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: 49
Location: India

PostPosted: Wed Apr 01, 2020 3:00 pm
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.

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: 2455
Location: Hampshire, UK

PostPosted: Wed Apr 01, 2020 3:53 pm
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

Senior Member


Joined: 29 Apr 2008
Posts: 2012
Location: USA

PostPosted: Wed Apr 01, 2020 11:36 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top