• Home
  • Troubleshoot
  • #Example
    • C
    • C++
    • Python
    • R-Programming
  • DSA
  • Quiz
  • Tutorial Videos
  • Home
  • Troubleshoot
  • #Example
    • C
    • C++
    • Python
    • R-Programming
  • DSA
  • Quiz
  • Tutorial Videos
  • #Deals
  • #News
  • #WiKi
  • #APPS
  • #Events
    • #WWDC
    • #I/O
    • #Ignite
  • #Let’s Talk

MyCodeTips mycodetips-newlogocopy1

  • Home
  • Troubleshoot
  • #Example
    • C
    • C++
    • Python
    • R-Programming
  • DSA
  • Quiz
  • Tutorial Videos
Database

Creating a Data File in AS400

Creating a Data File in AS400

To create a file named FTPOUT that is 100 characters in length:

CRTPF FILE(MYLIB/FTPOUT) RCDLEN(100)

The AS/400 actually creates a file named FTPOUT, a member named FTPOUT and a field of length 100 that is named FTPOUT.

To make a database file, you use the DDS specifications. You must start the Programming Development Manager and create a member with TYPE of PF (for physical file). Usually, this goes in the object QDDSSRC.

The first line defines the record name. For a simple 3 field file:
A R CUSREC
A NAME 20A
A PHONE 10S 0
A STATUS 1A
Name the member in QDDSSRC the same as the desired file. In this case, I named it CUS.
Then, you must compile or create the file. In PDM you can do this with the option 14. When you use option 14, you actually execute the command:

CRTPF FILE(MYLIB/CUS) SRCFILE(MYLIB/QDDSSRC) SRCMBR(CUS)

The AS/400 knows to use this command because you specified that this member is describing a PF.

If you have wanted a key built on the PHONE field, the DDS would have been:
A R CUSREC
A NAME 20A
A PHONE 10S 0
A STATUS 1A
A K PHONE

  • Click to share on Reddit (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Pocket (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
Written by Ranjan - 1468 Views
Tags | AS400, DATABASE
AUTHOR
Ranjan

I m Ranjan and Sharing my years of experience in Software Development. Love to code in Mobile apps (IOS, Android, Power Apps, Xamarin, Flutter), Machine Learning ( Beginner ), Dot Net, Databases ( SQL Server, MySql, SQLite), WordPress, Cloud Computing ( AWS, Azure, Google, MongoDB) and many more as required on project-specific. Besides this love to travel and cook.

You Might Also Like

mycodetips-newlogo2

How to Check your browser supports IndexedDB or not

October 8, 2013
1386376017 database

Tips for Database Normalization

December 6, 2013
1386376017 database

Tips for SQL Query Optimization

December 5, 2013
Next Post
Previous Post

Subscribe for updates

Join 6,916 other subscribers

whiteboard

Whiteboard(PRO)

whiteboard

Whiteboard(lite)

alphabets

Kids Alphabet

techlynk

Techlynk

techbyte

Do2Day

techbyte

Techbyte

Latest Posts

  • YT-Featured-Algorithm
    What is Algorithm?
  • Frameworks of IOS
    Frameworks of IOS – Part ( I )
  • NSFileManager or NSPathUtilities
    NSFileManager or NSPathUtilities in Objective-C
  • Passing data between view controllers in Objective-C
    Passing data between view controllers in Objective-C
  • structures-classes-enum
    Structures and Classes in swift !
  • control-system-swift
    Control Flow in Swift
  • swift-concurrency-await
    Concurrency in Swift
  • time-complexity-dsa
    The Term Time Complexity in DSA
  • objective-c-datatypes1
    Objective-C Data Types
  • Convert-jpeg-word
    Convert JPG to Word – Tips You Should Try!

Quick Links

  • #about
  • #myapps
  • #contact
  • #privacy

Other Websites

  • #myQuestions
  • #myBhojanalaya
  • #gadgetFacts
  • #ifscCodesDB

Tag Cloud

Algorithm Android Android Studio API APP Programming Apps blogging Browser Config CSS DATABASE dsa ecommerce error Features Google IO HTML HTML5 IDE installation Interview Questions IOS iPhone javascript Mac objective-c OneDrive OS Placeholder Programming quicktips SDK SEO Settings SMO SQL swift swiftUI Teams Tips & Tricks Tools UI Web Wordpress Xcode

©mycodetips.com