What is code of copy from ps file to gdg file and copy from gdg file to ps file in jcl.how i can do?

Showing Answers 1 - 9 of 9 Answers

srilkrishy

  • Aug 25th, 2006
 

The GDG is nothing but a sequential kind of file.You can just use the SORT to copy the GDG from a PS file.

Here is the SORT solution for the copy.

//SORT1 EXEC PGM=SORT

//SYSOUT DD SYSOUT=A 4

//SORTIN DD DSN=INPUT,DISP=SHR

//SORTOUT DD DSN=AAA.BBB.OUTPUT(+1),

// UNIT=SYSDA,DISP=(NEW,KEEP),

// DCB=(LRECL=100,RECFM=FB,

// BLKSIZE=0)

//SYSIN DD *

 SORT FIELDS=COPY

Thank you

Krishy

  Was this answer useful?  Yes

techieheart

  • Sep 11th, 2006
 

You can also make use of :1. the IDCAMS utility://step01 exec pgm=IDCAMS//sysprint dd sysout=*//inpds dd dsn=ps file name,disp=shr//outgdg dd dsn= gdg filename(+1), disp=(new,catlg,delete)...//sysin dd *repro - infile (inpds)- outfile (outgdg)/*2. IEBGENER utility//step01 exec pgm=IEBGENER//sysprint dd sysout=*//sysut1 dd dsn=ps file name,disp=shr//sysut2 dd dsn= gdg filename(+1), disp=(new,catlg,delete)...//sysin dd DUMMY/*

  Was this answer useful?  Yes

Both are nothing but flat files. You can use PGM=SORT in EXEC statement and in sysin you can use sort fields=copy. For example.

//JOBNAME ....

//STEP1          EXEC PGM=SORT

//SYSPRINT  DD  SYSOUT=*

//SORTIN       DD  DSN=A.B.C(0),DISP=SHR ---> GDG FILE

//SORTOUT   DD DSN=A1.B1.C1,DISP=SHR ---> FLAT FILE(PS FILE)

//SYSIN  DD   *

      SORT FIELDS=COPY

/*

//

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions